Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gauth

Pages: [1]
1
Feature requests / Re: sf::Vector2/3::Type typedef
« on: January 22, 2015, 03:55:05 pm »
Some templated vector functions like length and dot product. Also I use 64-bit int vectors, when possible, without differentiating the vector type name, so in some case, for example when storing one of the component into a temporary variable, I have to know the underlying type (32-bit or 64-bit). I admit the later problem is not very SFML-related, so I understand Laurent when he hesitate on the relevance of such feature (I understand now that's very specific to my problem).

2
Feature requests / Re: sf::Vector2/3::Type typedef
« on: January 22, 2015, 03:17:44 pm »
I have no more argument, clarity was my only one :P So this discussion ends there.

Thank you anyway and good afternoon !

3
Feature requests / Re: sf::Vector2/3::Type typedef
« on: January 22, 2015, 02:45:55 pm »
Sorry, I made some search before posting but I found nothing (bad keyword).

And why isn't that possible ? I assume it break no code. I understand you say "no" to larger features that are not in the range of features SFML provides. But, between
sf::Vector2i::Type
and
TypeOfVector<sf::Vector2i>::type
the first one is much clearer. And I think clear code is better in general.

Sorry to bother you with that.

4
Feature requests / sf::Vector2/3::Type typedef
« on: January 22, 2015, 02:21:07 pm »
Hi there !
Would it be possible to add a simple typedef in Vector2/3 describing the type the vector use ?
For example it would be nice for use in template function/class :
template <typename Vec>
Vec::Type addCoordinate(Vec vec)
{
    return x + y;
}
 

I know in C++11 we can use decltype to do that but i don't find it pleasant to read :
template <typename Vec>
decltype(Vec::x) addCoordinate(Vec vec)
{
    return x + y;
}
 

One line can "simplify" a lot of lines !
Thanks :)

Pages: [1]