.. _program_listing_file__tmp_ws_src_proxsuite_include_proxsuite_linalg_veg_type_traits_constructible.hpp: Program Listing for File constructible.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/proxsuite/include/proxsuite/linalg/veg/type_traits/constructible.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef VEG_CONSTRUCTIBLE_HPP_D6CRVBJYS #define VEG_CONSTRUCTIBLE_HPP_D6CRVBJYS #include "proxsuite/linalg/veg/type_traits/core.hpp" #include "proxsuite/linalg/veg/internal/prologue.hpp" #include #if !VEG_HAS_BUILTIN(__has_trivial_destructor) || \ !VEG_HAS_BUILTIN(__is_trivially_constructible) || \ !VEG_HAS_BUILTIN(__is_constructible) || \ !VEG_HAS_BUILTIN(__is_nothrow_constructible) || \ !VEG_HAS_BUILTIN(__is_trivially_copyable) || \ !VEG_HAS_BUILTIN(__is_trivial) || !VEG_HAS_BUILTIN(__is_final) || \ !VEG_HAS_BUILTIN(__is_empty) #include #endif namespace proxsuite { namespace linalg { namespace veg { namespace concepts { #if VEG_HAS_BUILTIN(__is_final) || defined(VEG_WITH_CXX14_SUPPORT) VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD(typename T, final, T); #else VEG_DEF_CONCEPT(typename T, final, (sizeof(T) < 0)); #endif VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD(typename T, empty, T); VEG_DEF_CONCEPT(typename T, nothrow_destructible, noexcept(static_cast(nullptr)->~T())); VEG_DEF_CONCEPT( typename T, trivially_destructible, VEG_HAS_BUILTIN_OR(__has_trivial_destructor, ((_detail::assert_complete<_detail::Wrapper>(), __has_trivial_destructor(T))), (std::is_trivially_destructible::value))); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD(typename T, trivially_copyable, T); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_TRAIT(typename T, trivially_default_constructible, is_trivially_constructible, T); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_TRAIT(typename T, trivially_copy_constructible, is_trivially_constructible, T, T const&); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_TRAIT(typename T, trivially_move_constructible, is_trivially_constructible, T, T&&); VEG_CONCEPT_EXPR((typename T, typename... Ts), (T, Ts...), inplace_constructible, new(static_cast(nullptr)) T(VEG_DECLVAL(Ts&&)...), true); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD((typename T, typename... Ts), constructible, T, Ts&&...); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD((typename T, typename... Ts), nothrow_constructible, T, Ts&&...); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD((typename From, typename To), convertible, From&&, To); VEG_DEF_CONCEPT((typename T, typename U), implicitly_constructible, VEG_CONCEPT(convertible)); VEG_DEF_CONCEPT(typename T, movable, VEG_HAS_BUILTIN_OR(__is_constructiblex, __is_constructible(T, T&&), (VEG_CONCEPT(constructible)))); VEG_DEF_CONCEPT( typename T, nothrow_movable, VEG_HAS_BUILTIN_OR(__is_nothrow_constructiblex, __is_nothrow_constructible(T, T&&), (VEG_CONCEPT(nothrow_constructible)))); VEG_DEF_CONCEPT(typename T, copyable, VEG_CONCEPT(constructible)); VEG_DEF_CONCEPT(typename T, nothrow_copyable, VEG_CONCEPT(nothrow_constructible)); } // namespace concepts namespace cpo { template struct is_trivially_constructible; template struct is_trivially_relocatable; } // namespace cpo namespace _detail { namespace _cpo { template class Trait, typename T> struct extract_members_deduce_trait_impl : meta::false_type {}; template class Trait, typename Tuple> struct member_trait_and; template class Trait, usize... Is, typename... Bases, typename... Ts> struct member_trait_and< Trait, SimpleITuple<_meta::integer_sequence, Ts Bases::*...>> : meta::bool_constant::value)> {}; template class Trait, typename T> struct extract_members_deduce_trait_impl : member_trait_and< Trait, decltype(_detail::member_extract_access::Type::member_pointers())> {}; template class Trait, typename T> struct extract_members_deduce_trait : extract_members_deduce_trait_impl<_detail::member_extract_access::value, Trait, T> {}; } // namespace _cpo } // namespace _detail namespace cpo { template struct is_trivially_constructible : meta::if_t< VEG_CONCEPT(trivially_default_constructible), meta::true_type, _detail::_cpo::extract_members_deduce_trait> {}; template struct is_trivially_relocatable : meta::if_t< VEG_CONCEPT(trivially_copyable) && VEG_CONCEPT(trivially_move_constructible), meta::true_type, _detail::_cpo::extract_members_deduce_trait> {}; } // namespace cpo namespace _detail { template struct DefaultFn { VEG_INLINE constexpr auto operator()() const&& VEG_NOEXCEPT_IF( VEG_CONCEPT(nothrow_constructible)) -> T { return T(); } }; template struct MoveFn { T&& value; VEG_INLINE constexpr auto operator()() const&& VEG_NOEXCEPT_IF( VEG_CONCEPT(nothrow_movable)) -> T { return T(VEG_FWD(value)); } }; template struct CopyFn { T const& value; VEG_INLINE constexpr auto operator()() const&& VEG_NOEXCEPT_IF( VEG_CONCEPT(nothrow_copyable)) -> T { return T(value); } }; template struct WithArg { Fn&& fn; T&& arg; VEG_INLINE constexpr auto operator()() const&& -> decltype(VEG_FWD(fn)( VEG_FWD(arg))) { return VEG_FWD(fn)(VEG_FWD(arg)); } }; } // namespace _detail } // namespace veg } // namespace linalg } // namespace proxsuite #include "proxsuite/linalg/veg/internal/epilogue.hpp" #endif /* end of include guard VEG_CONSTRUCTIBLE_HPP_D6CRVBJYS */