CETL 2.1.0
 
Loading...
Searching...
No Matches
cetl::pf17 Namespace Reference

Namespaces

namespace  pmr
 

Classes

class  bad_optional_access
 
class  bad_variant_access
 
class  basic_string_view
 
struct  conjunction
 
struct  conjunction< A >
 
struct  conjunction< A, B... >
 
struct  disjunction
 
struct  disjunction< A >
 
struct  disjunction< A, B... >
 
struct  in_place_index_t
 
struct  in_place_t
 
struct  in_place_type_t
 
struct  is_nothrow_swappable
 
struct  is_swappable
 
struct  monostate
 
struct  negation
 
struct  nullopt_t
 
class  optional
 
class  variant
 
struct  variant_alternative
 
struct  variant_alternative< N, const V< Ts... > >
 
struct  variant_alternative< N, V< Ts... > >
 
struct  variant_size
 
struct  variant_size< const V >
 
struct  variant_size< V< Ts... > >
 

Typedefs

using string_view = basic_string_view<char>
 
template<typename...>
using void_t = void
 
template<size_t N, typename V>
using variant_alternative_t = typename variant_alternative<N, V>::type
 

Enumerations

enum class  byte : unsigned char
 

Functions

template<typename InputIt, typename ForwardIt>
ForwardIt uninitialized_move (InputIt first, InputIt last, ForwardIt destination)
 
template<typename T>
CETL_NODISCARD constexpr T * launder (T *const p) noexcept
 
template<typename CharT>
void swap (basic_string_view< CharT > &lhs, basic_string_view< CharT > &rhs) noexcept
 
constexpr bool operator== (const monostate, const monostate) noexcept
 
constexpr bool operator!= (const monostate, const monostate) noexcept
 
constexpr bool operator< (const monostate, const monostate) noexcept
 
constexpr bool operator> (const monostate, const monostate) noexcept
 
constexpr bool operator<= (const monostate, const monostate) noexcept
 
constexpr bool operator>= (const monostate, const monostate) noexcept
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr bool holds_alternative (const variant< Ts... > &var) noexcept
 
template<typename Fun, typename... Vs>
constexpr decltype(auto) visit (Fun &&fun, Vs &&... vars)
 
template<typename... Ts>
constexpr bool operator== (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename... Ts>
constexpr bool operator!= (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename... Ts>
constexpr bool operator< (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename... Ts>
constexpr bool operator> (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename... Ts>
constexpr bool operator<= (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename... Ts>
constexpr bool operator>= (const variant< Ts... > &lhs, const variant< Ts... > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> operator== (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> operator!= (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> operator< (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> operator<= (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> operator> (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> operator>= (const optional< T > &lhs, const optional< U > &rhs)
 
template<typename T>
constexpr bool operator== (const optional< T > &opt, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator== (const nullopt_t, const optional< T > &opt) noexcept
 
template<typename T>
constexpr bool operator!= (const optional< T > &opt, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator!= (const nullopt_t, const optional< T > &opt) noexcept
 
template<typename T>
constexpr bool operator< (const optional< T > &, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator< (const nullopt_t, const optional< T > &opt) noexcept
 
template<typename T>
constexpr bool operator<= (const optional< T > &opt, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator<= (const nullopt_t, const optional< T > &) noexcept
 
template<typename T>
constexpr bool operator> (const optional< T > &opt, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator> (const nullopt_t, const optional< T > &) noexcept
 
template<typename T>
constexpr bool operator>= (const optional< T > &, const nullopt_t) noexcept
 
template<typename T>
constexpr bool operator>= (const nullopt_t, const optional< T > &opt) noexcept
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> operator== (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> operator== (const T &value, const optional< U > &opt)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> operator!= (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> operator!= (const T &value, const optional< U > &opt)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> operator< (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> operator< (const T &value, const optional< U > &opt)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> operator<= (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> operator<= (const T &value, const optional< U > &opt)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> operator> (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> operator> (const T &value, const optional< U > &opt)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> operator>= (const optional< T > &opt, const U &value)
 
template<typename T, typename U>
constexpr detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> operator>= (const T &value, const optional< U > &opt)
 
template<typename T>
constexpr optional< std::decay_t< T > > make_optional (T &&value)
 
template<typename T, typename... Args>
constexpr optional< T > make_optional (Args &&... args)
 
template<typename T, typename U, typename... Args>
constexpr optional< T > make_optional (std::initializer_list< U > il, Args &&... args)
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< variant_alternative_t< Ix, variant< Ts... > > > get_if (variant< Ts... > *const var) noexcept
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< const variant_alternative_t< Ix, variant< Ts... > > > get_if (const variant< Ts... > *const var) noexcept
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< T > get_if (variant< Ts... > *const var) noexcept
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< const T > get_if (const variant< Ts... > *const var) noexcept
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr variant_alternative_t< Ix, variant< Ts... > > & get (variant< Ts... > &var)
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr variant_alternative_t< Ix, variant< Ts... > > && get (variant< Ts... > &&var)
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr const variant_alternative_t< Ix, variant< Ts... > > & get (const variant< Ts... > &var)
 
template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr const variant_alternative_t< Ix, variant< Ts... > > && get (const variant< Ts... > &&var)
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr T & get (variant< Ts... > &var)
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr T && get (variant< Ts... > &&var)
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr const T & get (const variant< Ts... > &var)
 
template<typename T, typename... Ts>
CETL_NODISCARD constexpr const T && get (const variant< Ts... > &&var)
 

Variables

constexpr nullopt_t nullopt {nullopt_t::_detail::_detail}
 
template<typename T>
constexpr bool is_swappable_v = is_swappable<T>::value
 
template<typename T>
constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<T>::value
 
template<typename... Ts>
constexpr bool conjunction_v = conjunction<Ts...>::value
 
template<typename... Ts>
constexpr bool disjunction_v = disjunction<Ts...>::value
 
template<typename T>
constexpr bool negation_v = negation<T>::value
 
constexpr in_place_t in_place {}
 
template<typename T>
constexpr in_place_type_t< T > in_place_type {}
 
template<std::size_t I>
constexpr in_place_index_t< I > in_place_index {}
 
constexpr std::size_t variant_npos = std::numeric_limits<std::size_t>::max()
 
template<typename V>
constexpr size_t variant_size_v = variant_size<V>::value
 

Detailed Description

This namespace contains C++17 polyfill (pf) types.

The types within this namespace adhere to the C++17 specification and should be drop-in replaceable with said standard types where they are available. CETL polyfill types may implement a sub-set of the required functionality but they will not implement non-compliant functionality.

Typedef Documentation

◆ variant_alternative_t

template<size_t N, typename V>
using cetl::pf17::variant_alternative_t = typename variant_alternative<N, V>::type

Implementation of std::variant_alternative_t.

This implementation also accepts other typelist-parameterized classes, such as std::variant.

◆ void_t

template<typename...>
using cetl::pf17::void_t = void

Implementation of std::void_t.

Enumeration Type Documentation

◆ byte

enum class cetl::pf17::byte : unsigned char
strong

A non-character type that implements the concept of a byte defined by the C++17 specification.

Function Documentation

◆ get() [1/8]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr const variant_alternative_t< Ix, variant< Ts... > > && cetl::pf17::get ( const variant< Ts... > && var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, get(), and cetl::pf17::variant< Ts >::index().

◆ get() [2/8]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr const T && cetl::pf17::get ( const variant< Ts... > && var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, and get().

◆ get() [3/8]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr const variant_alternative_t< Ix, variant< Ts... > > & cetl::pf17::get ( const variant< Ts... > & var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, get(), and cetl::pf17::variant< Ts >::index().

◆ get() [4/8]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr const T & cetl::pf17::get ( const variant< Ts... > & var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, and get().

◆ get() [5/8]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr variant_alternative_t< Ix, variant< Ts... > > && cetl::pf17::get ( variant< Ts... > && var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, get(), and cetl::pf17::variant< Ts >::index().

◆ get() [6/8]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr T && cetl::pf17::get ( variant< Ts... > && var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, and get().

◆ get() [7/8]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr variant_alternative_t< Ix, variant< Ts... > > & cetl::pf17::get ( variant< Ts... > & var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, get(), and cetl::pf17::variant< Ts >::index().

Referenced by get(), get(), get(), and get().

Here is the caller graph for this function:

◆ get() [8/8]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr T & cetl::pf17::get ( variant< Ts... > & var)
constexpr

Implementation of std::get(std::variant).

References CETL_NODISCARD, and get().

◆ get_if() [1/4]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< const variant_alternative_t< Ix, variant< Ts... > > > cetl::pf17::get_if ( const variant< Ts... > *const var)
constexprnoexcept

Implementation of std::get_if(std::variant).

References CETL_NODISCARD, get_if(), and cetl::pf17::variant< Ts >::index().

◆ get_if() [2/4]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< const T > cetl::pf17::get_if ( const variant< Ts... > *const var)
constexprnoexcept

Implementation of std::get_if(std::variant).

References CETL_NODISCARD, and get_if().

◆ get_if() [3/4]

template<std::size_t Ix, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< variant_alternative_t< Ix, variant< Ts... > > > cetl::pf17::get_if ( variant< Ts... > *const var)
constexprnoexcept

Implementation of std::get_if(std::variant).

References CETL_NODISCARD, get_if(), and cetl::pf17::variant< Ts >::index().

Referenced by get_if(), and get_if().

Here is the caller graph for this function:

◆ get_if() [4/4]

template<typename T, typename... Ts>
CETL_NODISCARD constexpr std::add_pointer_t< T > cetl::pf17::get_if ( variant< Ts... > *const var)
constexprnoexcept

Implementation of std::get_if(std::variant).

References CETL_NODISCARD, and get_if().

◆ holds_alternative()

template<typename T, typename... Ts>
CETL_NODISCARD constexpr bool cetl::pf17::holds_alternative ( const variant< Ts... > & var)
constexprnoexcept

Implementation of std::holds_alternative.

References CETL_NODISCARD, holds_alternative(), and cetl::pf17::variant< Ts >::index().

Referenced by holds_alternative().

Here is the caller graph for this function:

◆ launder()

template<typename T>
CETL_NODISCARD constexpr T * cetl::pf17::launder ( T *const p)
constexprnoexcept

Returns a pointer to the object of type T that is located at the address p holds.

Since C++17 (P0137R1) a pointer obtained by casting the address of some storage does not point to an object that was later created in that storage with placement new; it has to be passed through std::launder first. This is std::launder where the standard library provides it. Before C++17 the cast pointer already points to the object, so this returns p unchanged.

Template Parameters
TThe type of the object. Must not be a function type or (cv-qualified) void.
Parameters
pThe address of an object of type T that is within its lifetime.
Returns
A pointer to that object.

References CETL_NODISCARD, and std::launder().

◆ make_optional() [1/3]

template<typename T, typename... Args>
optional< T > cetl::pf17::make_optional ( Args &&... args)
constexpr

An implementation of C++17 std::make_optional.

References std::forward(), in_place, and make_optional().

◆ make_optional() [2/3]

template<typename T, typename U, typename... Args>
optional< T > cetl::pf17::make_optional ( std::initializer_list< U > il,
Args &&... args )
constexpr

An implementation of C++17 std::make_optional.

References std::forward(), in_place, and make_optional().

◆ make_optional() [3/3]

template<typename T>
optional< std::decay_t< T > > cetl::pf17::make_optional ( T && value)
constexpr

An implementation of C++17 std::make_optional.

References std::forward(), and make_optional().

Referenced by make_optional(), make_optional(), and make_optional().

Here is the caller graph for this function:

◆ operator!=() [1/5]

template<typename T>
bool cetl::pf17::operator!= ( const nullopt_t ,
const optional< T > & opt )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator!=().

◆ operator!=() [2/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> cetl::pf17::operator!= ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

Referenced by operator!=(), and operator!=().

Here is the caller graph for this function:

◆ operator!=() [3/5]

template<typename T>
bool cetl::pf17::operator!= ( const optional< T > & opt,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator!=().

◆ operator!=() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> cetl::pf17::operator!= ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator!=() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() !=std::declval< const U & >())> cetl::pf17::operator!= ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator<() [1/5]

template<typename T>
bool cetl::pf17::operator< ( const nullopt_t ,
const optional< T > & opt )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator<().

◆ operator<() [2/5]

template<typename T>
bool cetl::pf17::operator< ( const optional< T > & ,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator<().

◆ operator<() [3/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> cetl::pf17::operator< ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

References cetl::pf17::optional< T >::has_value().

Referenced by operator<(), and operator<().

Here is the caller graph for this function:

◆ operator<() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> cetl::pf17::operator< ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator<() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()< std::declval< const U & >())> cetl::pf17::operator< ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator<=() [1/5]

template<typename T>
bool cetl::pf17::operator<= ( const nullopt_t ,
const optional< T > &  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator<=().

◆ operator<=() [2/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> cetl::pf17::operator<= ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

Referenced by operator<=(), and operator<=().

Here is the caller graph for this function:

◆ operator<=() [3/5]

template<typename T>
bool cetl::pf17::operator<= ( const optional< T > & opt,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator<=().

◆ operator<=() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> cetl::pf17::operator<= ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator<=() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()<=std::declval< const U & >())> cetl::pf17::operator<= ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator==() [1/5]

template<typename T>
bool cetl::pf17::operator== ( const nullopt_t ,
const optional< T > & opt )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator==().

◆ operator==() [2/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> cetl::pf17::operator== ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

References cetl::pf17::optional< T >::has_value().

Referenced by operator==(), and operator==().

Here is the caller graph for this function:

◆ operator==() [3/5]

template<typename T>
bool cetl::pf17::operator== ( const optional< T > & opt,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator==().

◆ operator==() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> cetl::pf17::operator== ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator==() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >()==std::declval< const U & >())> cetl::pf17::operator== ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator>() [1/5]

template<typename T>
bool cetl::pf17::operator> ( const nullopt_t ,
const optional< T > &  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator>().

◆ operator>() [2/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> cetl::pf17::operator> ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

Referenced by operator>(), and operator>().

Here is the caller graph for this function:

◆ operator>() [3/5]

template<typename T>
bool cetl::pf17::operator> ( const optional< T > & opt,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator>().

◆ operator>() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> cetl::pf17::operator> ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator>() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() > std::declval< const U & >())> cetl::pf17::operator> ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator>=() [1/5]

template<typename T>
bool cetl::pf17::operator>= ( const nullopt_t ,
const optional< T > & opt )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator>=().

◆ operator>=() [2/5]

template<typename T>
bool cetl::pf17::operator>= ( const optional< T > & ,
const nullopt_t  )
constexprnoexcept

Compares an optional with a nullopt.

Equivalent to the above case when comparing to an optional that does not contain a value.

References operator>=().

◆ operator>=() [3/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> cetl::pf17::operator>= ( const optional< T > & lhs,
const optional< U > & rhs )
constexpr

Compares two optional objects, lhs and rhs.

The contained values are compared (using the corresponding operator of T) only if both lhs and rhs contain values. Otherwise,

  • lhs is considered equal to rhs if, and only if, both lhs and rhs do not contain a value.
  • lhs is considered less than rhs if, and only if, rhs contains a value and lhs does not.

Referenced by operator>=(), and operator>=().

Here is the caller graph for this function:

◆ operator>=() [4/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> cetl::pf17::operator>= ( const optional< T > & opt,
const U & value )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ operator>=() [5/5]

template<typename T, typename U>
detail::opt::enable_comparison< decltype(std::declval< const T & >() >=std::declval< const U & >())> cetl::pf17::operator>= ( const T & value,
const optional< U > & opt )
constexpr

Compares an optional with a value.

The values are compared (using the corresponding operator of T) only if the optional contains a value. Otherwise, the optional is considered less than value.

References cetl::pf17::optional< T >::has_value().

◆ swap()

template<typename CharT>
void cetl::pf17::swap ( basic_string_view< CharT > & lhs,
basic_string_view< CharT > & rhs )
noexcept

Exchanges the given string views.

◆ uninitialized_move()

template<typename InputIt, typename ForwardIt>
ForwardIt cetl::pf17::uninitialized_move ( InputIt first,
InputIt last,
ForwardIt destination )

Polyfill for std::uninitialized_move.

Implements the sequential, three-argument overload. Constructs objects from [first, last) in uninitialized storage starting at destination. Execution-policy overloads and uninitialized_move_n are not provided.

Lvalue sources are moved from, even when copying could avoid a throwing move constructor. Other source expressions retain their value category, as specified by LWG 3918. The destination value type must be constructible from std::move(*first) for lvalue source expressions, or from *first otherwise, under the active C++ language version's initialization rules.

The source range must be valid and must not overlap the destination range. The destination must provide sufficient, suitably aligned uninitialized storage for every source element. Destruction of destination objects must not throw. The caller owns the destination storage; this function neither allocates nor deallocates it. On success, all constructed objects remain alive and the caller is responsible for destroying them.

When dereferencing the source produces a prvalue of the destination type, C++17 and newer require no copy/move constructor for destination construction. In C++14, the selected copy/move constructor must be accessible and not deleted, and callers must not assume that its invocation will be elided.

Source elements may already have been moved from when an exception occurs; their original values are not restored. When compiled with exceptions disabled, no exception rollback is provided.

Complexity is linear in the number of source elements, with one destination construction per element on success.

Template Parameters
InputItSource iterator type meeting the input iterator requirements.
ForwardItDestination iterator type meeting the forward iterator requirements. Assignment, comparison, increment, and indirection through valid iterators must not throw, and indirection must yield a reference to the iterator's value_type.
Parameters
firstBeginning of the source range.
lastEnd of the source range.
destinationBeginning of the destination storage.
Returns
Iterator immediately past the constructed destination range, or destination if the source range is empty.
Exceptions
...With exceptions enabled, propagates any exception from construction or a source iterator operation. Every destination object successfully constructed by this call is destroyed exactly once before propagation, in an unspecified order. The object whose constructor failed is not destroyed.

◆ visit()

template<typename Fun, typename... Vs>
decltype(auto) cetl::pf17::visit ( Fun && fun,
Vs &&... vars )
constexpr

Implementation of std::visit.

References std::forward(), and visit().

Referenced by visit().

Here is the caller graph for this function:

Variable Documentation

◆ conjunction_v

template<typename... Ts>
bool cetl::pf17::conjunction_v = conjunction<Ts...>::value
constexpr

Implementation of std::conjunction_v.

◆ disjunction_v

template<typename... Ts>
bool cetl::pf17::disjunction_v = disjunction<Ts...>::value
constexpr

Implementation of std::disjunction_v.

◆ in_place

◆ in_place_index

◆ in_place_type

template<typename T>
in_place_type_t<T> cetl::pf17::in_place_type {}
constexpr

Implementation of std::in_place_type.

◆ is_nothrow_swappable_v

template<typename T>
bool cetl::pf17::is_nothrow_swappable_v = is_nothrow_swappable<T>::value
constexpr

◆ is_swappable_v

template<typename T>
bool cetl::pf17::is_swappable_v = is_swappable<T>::value
constexpr

Implementation of std::is_swappable_v.

◆ negation_v

template<typename T>
bool cetl::pf17::negation_v = negation<T>::value
constexpr

Implementation of std::negation_v.

◆ nullopt

nullopt_t cetl::pf17::nullopt {nullopt_t::_detail::_detail}
constexpr

An implementation of C++17 std::nullopt.

◆ variant_npos

std::size_t cetl::pf17::variant_npos = std::numeric_limits<std::size_t>::max()
constexpr

Implementation of std::variant_npos.

Referenced by cetl::pf17::variant< Ts >::valueless_by_exception().

◆ variant_size_v

template<typename V>
size_t cetl::pf17::variant_size_v = variant_size<V>::value
constexpr

Implementation of std::variant_size_v.

This implementation also accepts other typelist-parameterized classes, such as std::variant.