// Copyright 2017 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt #include #if !defined( BOOST_MP11_HAS_CXX14_CONSTEXPR ) int main() {} #else #include #include using boost::mp11::mp_size_t; using boost::mp11::mp_with_index; struct F { template constexpr std::size_t operator()( mp_size_t ) const { return I; } }; #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) int main() { constexpr std::size_t i = mp_with_index<64>( 57, F{} ); STATIC_ASSERT( i == 57 ); } #endif