Waiter, there's an if in my loop!
Assuming statement is a std::string, you can get rid of both:
auto pos = statement.find_first_of(";()");
bool hasParenthesis = (pos != std::string::npos) && (statement[pos] != ';');
Some member functions of std::string are actually useful!
Pointers sharp are very null. Construct dynamic much object, decltype shift. Disk seek on Monday is segmentation fail. Functions. Arrays. Struct programming! He comes.
@Rapptz Line 256: union storage_t { unsigned char dummy_; T value_; ... } Line 289: struct optional_base { bool init_; storage_t<T> storage_; ... } How is that not "a T and a bool"? I completely agree the implementation is very tricky and nontrivial, but conceptually and concretely the type is a T and a bool. "The naive T and bool approach would fail pretty quickly." How can you make this statement when looking at the code? — Timothy Shields16 mins ago
I had this first, but what if i have to add a player? then the pointers will be point to the wrong adress when it is a vector<Player*>. And working withouth pointers seems not a good idea to me here. — jimbo99942 secs ago