absl::implicit_cast

implicit_cast overloads

Synopses

Declared in <absl/base/casts.h>

Performs an implicit conversion between types following the language rules for implicit conversion; if an implicit conversion is otherwise allowed by the language in the given context, this function performs such an implicit conversion.

template<typename To>
constexpr
To
implicit_cast(To to)
requires !type_traits_internal::IsView<std::enable_if_t<
        !std::is_reference_v<To>, std::remove_cv_t<To>>>::value;
» more...

Performs an implicit conversion between types following the language rules for implicit conversion; if an implicit conversion is otherwise allowed by the language in the given context, this function performs such an implicit conversion.

template<typename To>
constexpr
To
implicit_cast(To to)
requires !type_traits_internal::IsView<std::enable_if_t<
        !std::is_reference_v<To>, std::remove_cv_t<To>>>::value;
» more...

Overload of implicit_cast() for view types (such as std::string_view), which participates in overload resolution when To is a non-reference view type.

template<typename To>
constexpr
To
implicit_cast(To to)
requires type_traits_internal::IsView<std::enable_if_t<!std::is_reference_v<To>,
                                                  std::remove_cv_t<To>>>::value;
» more...

Overload of implicit_cast() for view types (such as std::string_view), which participates in overload resolution when To is a non-reference view type.

template<typename To>
constexpr
To
implicit_cast(To to)
requires type_traits_internal::IsView<std::enable_if_t<!std::is_reference_v<To>,
                                                  std::remove_cv_t<To>>>::value;
» more...

Overload of implicit_cast() for reference types, which participates in overload resolution when To is a reference type.

template<typename To>
constexpr
To
implicit_cast(To to)
requires std::is_reference_v<To>;
» more...

Return Value

The value of to, converted to To.

Parameters

NameDescription
toThe value to convert to To.