diff --git a/include/boost/variant2/variant.hpp b/include/boost/variant2/variant.hpp index 3cf2dc1..c109632 100644 --- a/include/boost/variant2/variant.hpp +++ b/include/boost/variant2/variant.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_VARIANT2_VARIANT_HPP_INCLUDED #define BOOST_VARIANT2_VARIANT_HPP_INCLUDED -// Copyright 2017, 2018 Peter Dimov. +// Copyright 2017-2019 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -266,6 +266,10 @@ template struct variant_alternative> #endif +// variant_npos + +constexpr std::size_t variant_npos = -1; + // holds_alternative template constexpr bool holds_alternative( variant const& v ) noexcept @@ -1350,6 +1354,11 @@ public: // value status + constexpr bool valueless_by_exception() const noexcept + { + return false; + } + using variant_base::index; // swap