mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-29 19:57:18 +02:00
Add variant_npos and valueless_by_exception()
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user