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 - sill49

Pages: [1]
1
General / Re: Inheriting from sf::Drawable.
« on: July 29, 2018, 06:55:09 pm »
It doesn't need to be constexpr, but it's a nice addition. For example, I have an array of 52 cards (the default deck) which can be resolved at compile-time.

2
General / Inheriting from sf::Drawable.
« on: July 29, 2018, 06:26:04 pm »
Hi there. I'm currently implementing a game of cards in SFML. Obviously, I would like to draw some cards, and I need my object-oriented design to be as flexible as possible for further development.

Therefore, I considered to inherit the Card class from sf::Drawable. The problem is that my Card constructor is constexpr and the sf::Drawable's constructor is not. At least that's what I understand from the error message: constexpr constructor calls non-constexpr function sf::Drawable::Drawable() noexcept".

I could take away the constexpr specifier from the constructor, but there are other pieces of code that rely on that constexpr constructor.

What would be your advice for me? Thanks in advance.

Pages: [1]