.. _program_listing_file__tmp_ws_src_proxsuite_include_proxsuite_linalg_veg_internal_narrow.hpp: Program Listing for File narrow.hpp =================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/proxsuite/include/proxsuite/linalg/veg/internal/narrow.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef VEG_NARROW_HPP_H0EXKJTAS #define VEG_NARROW_HPP_H0EXKJTAS #include "proxsuite/fwd.hpp" #include "proxsuite/linalg/veg/util/assert.hpp" #include "proxsuite/linalg/veg/internal/prologue.hpp" #include "proxsuite/helpers/common.hpp" namespace proxsuite { namespace linalg { namespace veg { namespace nb { template struct narrow { VEG_TEMPLATE((typename From), requires VEG_CONCEPT(integral) && VEG_CONCEPT(integral), constexpr auto operator(), (from, From)) const VEG_NOEXCEPT->To { #if defined(VEG_WITH_CXX14_SUPPORT) To to = static_cast(from); PROXSUITE_MAYBE_UNUSED From roundtrip_from = static_cast(static_cast(from)); VEG_INTERNAL_ASSERT_PRECONDITION(roundtrip_from == from); return to; #else return VEG_INTERNAL_ASSERT_PRECONDITION( static_cast(static_cast(from)) == from), static_cast(from); #endif } }; } // namespace nb VEG_NIEBLOID_TEMPLATE(typename To, narrow, To); } // namespace veg } // namespace linalg } // namespace proxsuite #include "proxsuite/linalg/veg/internal/epilogue.hpp" #endif /* end of include guard VEG_NARROW_HPP_H0EXKJTAS */