![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
Boost.Hana: OrderableBoost , ,
Variable Documentation
< = [](auto&& x, auto&& y) -> decltype(auto) { return tag-dispatched; } Возвращает< SignatureПри наличии логических<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/greater.hpp> #include <boost/hana/integral_constant.hpp> namespace hana = boost::hana; static_assert(hana::greater(4, 1), ""); BOOST_HANA_CONSTANT_CHECK(!hana::greater(hana::int_c<1>, hana::int_c<3>)); int main() { }
< = [](auto&& x, auto&& y) -> decltype(auto) { return tag-dispatched; } Возвращает< SignatureПри наличии логических<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/greater_equal.hpp> #include <boost/hana/integral_constant.hpp> namespace hana = boost::hana; static_assert(hana::greater_equal(4, 1), ""); static_assert(hana::greater_equal(1, 1), ""); BOOST_HANA_CONSTANT_CHECK(!hana::greater_equal(hana::int_c<1>, hana::int_c<2>)); int main() { }
< = [](auto&& x, auto&& y) { return tag-dispatched; } Возвращает< SignatureПри наличии логических<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/all_of.hpp> #include <boost/hana/assert.hpp> #include <boost/hana/integral_constant.hpp> #include <boost/hana/less.hpp> #include <boost/hana/not.hpp> #include <boost/hana/tuple.hpp> namespace hana = boost::hana; static_assert(hana::less(1, 4), ""); BOOST_HANA_CONSTANT_CHECK(!hana::less(hana::int_c<3>, hana::int_c<2>)); // less.than is syntactic sugar BOOST_HANA_CONSTANT_CHECK(hana::all_of(hana::tuple_c<int, 1, 2, 3, 4>, hana::less_equal.than(hana::int_c<4>))); int main() { }
< = [](auto&& x, auto&& y) { return tag-dispatched; } Возвращает< SignatureПри наличии логических<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/integral_constant.hpp> #include <boost/hana/less_equal.hpp> #include <boost/hana/not.hpp> namespace hana = boost::hana; static_assert(hana::less_equal(1, 4), ""); static_assert(hana::less_equal(1, 1), ""); BOOST_HANA_CONSTANT_CHECK(!hana::less_equal(hana::int_c<3>, hana::int_c<2>)); int main() { }
< = [](auto&& x, auto&& y) -> decltype(auto) { return tag-dispatched; } Возвращает наибольший из своих аргументов согласно<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/equal.hpp> #include <boost/hana/integral_constant.hpp> #include <boost/hana/max.hpp> namespace hana = boost::hana; static_assert(hana::max(1, 4) == 4, ""); BOOST_HANA_CONSTANT_CHECK(hana::max(hana::int_c<7>, hana::int_c<5>) == hana::int_c<7>); int main() { }
< = [](auto&& x, auto&& y) -> decltype(auto) { return tag-dispatched; } Возвращает наименьший из своих аргументов в соответствии с приказом<
Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/equal.hpp> #include <boost/hana/integral_constant.hpp> #include <boost/hana/min.hpp> namespace hana = boost::hana; static_assert(hana::min(1, 4) == 1, ""); BOOST_HANA_CONSTANT_CHECK(hana::min(hana::int_c<7>, hana::int_c<5>) == hana::int_c<5>); int main() { }
< = [](auto&& f) { return less(f(forwarded(x)), f(forwarded(y))); }; } constexpr auto less Returns a Logical representing whether x is less than y. Definition: less.hpp:37 constexpr auto capture Create a function capturing the given variables. Definition: capture.hpp:45 Возвращает функцию, выполняющуюся< В частности,< или, эквивалентно,
SignatureПри наличии логических< Example// Copyright Louis Dionne 2013-2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include <boost/hana/assert.hpp> #include <boost/hana/equal.hpp> #include <boost/hana/ordering.hpp> #include <boost/hana/sort.hpp> #include <boost/hana/tuple.hpp> #include <boost/hana/type.hpp> namespace hana = boost::hana; hana::tuple_t<char[3], char[1], char[2], char[15]> ); int main() { } Статья Boost.Hana: Orderable раздела может быть полезна для разработчиков на c++ и boost. Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта. :: Главная :: ::
| ©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
| |