/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Library/boost/libs/array/test/array_constexpr.cpp
39 строк
899 B
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
/* tests using constexpr on boost:array * (C) Copyright Marshall Clow 2012 * 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 <string> #include <iostream> #include <boost/array.hpp> #include <algorithm> #ifndef BOOST_NO_CXX11_HDR_ARRAY #include <array> #endif #ifndef BOOST_NO_CXX11_CONSTEXPR constexpr boost::array<int, 10> arr {{ 0,1,2,3,4,5,6,7,8,9 }}; constexpr std::array<int, 10> arr_std {{ 0,1,2,3,4,5,6,7,8,9 }}; template <typename T> void sink ( T t ) {} template <typename T, size_t N> void sink ( boost::array<T,N> &arr ) {} int main() { // constexpr int two = arr_std.at (2); constexpr int three = arr.at (3); int whatever [ arr.at(4) ]; (void)three; (void) whatever; } #else // no constexpr means no constexpr tests! int main() { } #endif