3 ms·
It's not hard to write an optional<T> in C++ 2003, and likely can be done in C++ 98. If you don't like that, return a T*, null if not created correctly.
by ChrisLomont 7y ago
It's not hard to write an optional<T> in C++ 2003, and likely can be done in C++ 98.
If you don't like that, return a T*, null if not created correctly.
- hoistbypetard 7y agoI didn't mean to suggest the language spec would have made it hard so much as that I'd have really not wanted to approach it in a way that was going to work with VC6/2002/2005/gcc 2.95/sunpro/ibm/hp compilers of the era. (I think it was 2009 before I got to push VC6 off the raft.) ISO support in C++ compilers was really bad for a long time. Our typical pattern was to return T*. But that fits well with the "I should have just written it in C" argument IMO.