forked from boostorg/variant2
Add variant_npos and valueless_by_exception()
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#ifndef BOOST_VARIANT2_VARIANT_HPP_INCLUDED
|
#ifndef BOOST_VARIANT2_VARIANT_HPP_INCLUDED
|
||||||
#define 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.
|
// 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
|
#endif
|
||||||
|
|
||||||
|
// variant_npos
|
||||||
|
|
||||||
|
constexpr std::size_t variant_npos = -1;
|
||||||
|
|
||||||
// holds_alternative
|
// holds_alternative
|
||||||
|
|
||||||
template<class U, class... T> constexpr bool holds_alternative( variant<T...> const& v ) noexcept
|
template<class U, class... T> constexpr bool holds_alternative( variant<T...> const& v ) noexcept
|
||||||
@ -1350,6 +1354,11 @@ public:
|
|||||||
|
|
||||||
// value status
|
// value status
|
||||||
|
|
||||||
|
constexpr bool valueless_by_exception() const noexcept
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
using variant_base::index;
|
using variant_base::index;
|
||||||
|
|
||||||
// swap
|
// swap
|
||||||
|
Reference in New Issue
Block a user