mrkkrj / mini-stdopt

An "in-place" replacement of std::optional for ancient (Microsoft...;) compilers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mini-stdopt

An "in-place" replacement of std::optional for ancient (Microsoft... ;) compilers. Your compiler will need C++11 support though (as C++98 wasn't tested)!

** WIP!!! ** -> VisualStudio 2015 example missing, much more tests needed!

Example:

#include <MiniStdOptional.h>

namespace opt = ibkrj::stdopt_wrap;

void optTest()
{
   opt::optional<int> optInt(1);
   assert(optInt.has_value());
   auto val = optInt.value();

   optInt = opt::nullopt;
   assert(!optInt.has_value());
}

TODO:

  • add VisualStudio 2015 example
  • add (more) tests
  • add description
  • add CMake support

About

An "in-place" replacement of std::optional for ancient (Microsoft...;) compilers.

License:MIT License


Languages

Language:C++ 100.0%