Add variant_npos and valueless_by_exception()

This commit is contained in:
Peter Dimov
2019-03-25 16:17:06 +02:00
parent 688849f9e8
commit 9875cfdc98

View File

@ -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<std::size_t I, class... T> struct variant_alternative<I, variant<T...>>
#endif
// variant_npos
constexpr std::size_t variant_npos = -1;
// holds_alternative
template<class U, class... T> constexpr bool holds_alternative( variant<T...> const& v ) noexcept
@ -1350,6 +1354,11 @@ public:
// value status
constexpr bool valueless_by_exception() const noexcept
{
return false;
}
using variant_base::index;
// swap