Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
General
»
Feature requests
»
Add public typedef to Vector2
Print
Pages: [
1
]
Author
Topic: Add public typedef to Vector2 (Read 2793 times)
0 Members and 2 Guests are viewing this topic.
Neil
Newbie
Posts: 27
Add public typedef to Vector2
«
on:
December 29, 2014, 08:03:32 pm »
Hi
Could this be added to Vector2 type please?
typedef
T type
;
I have some general template code, but I'm stuck, because I cannot query the type contained in vector. I would like to do Vector2::type.
Thank you.
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11030
Re: Add public typedef to Vector2
«
Reply #1 on:
December 29, 2014, 08:12:00 pm »
Why do you need to "query" that?
If you're in a general template code, you either should be able to assume a certain type or use the template type and since
sf::Vector2
is a template as well, you could just do
sf::Vector2<T>
.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Laurent
Administrator
Hero Member
Posts: 32498
Re: Add public typedef to Vector2
«
Reply #2 on:
December 29, 2014, 09:06:21 pm »
Do it yourself:
template
<
typename
T
>
struct
TypeOfVector
{
}
;
template
<
typename
T
>
struct
TypeOfVector
<
sf
::
Vector2
<
T
>>
{
typedef
T type
;
}
;
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
General
»
Feature requests
»
Add public typedef to Vector2