Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Boost.Hana: boost::hana::basic_type< T > Struct Template Reference

Boost , ,

Boost.Hana  1.0.1
Your standard library for metaprogramming
Базовый класс<hana::type>; используется для сопоставления шаблонов.

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/core/demangle.hpp>
#include <cstdlib>
#include <iostream>
#include <string>
namespace hana = boost::hana;
// Using hana::type<T> as a parameter type wouldn't work, since it may be
// a dependent type, in which case template argument deduction will fail.
// Using hana::basic_type<T> is fine, since this one is guaranteed to be
// a non dependent base of hana::type<T>.
template <typename T>
std::string const& name_of(hana::basic_type<T>) {
static std::string name = boost::core::demangle(typeid(T).name());
return name;
}
int main() {
hana::for_each(hana::tuple_t<int, char, void, std::string>, [](auto type) {
std::cout << name_of(type) << std::endl;
});
}

Наследуется бустером::hana::type_impl< T>::_.

Статья Boost.Hana: boost::hana::basic_type< T > Struct Template Reference раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 23:27:49/0.0059599876403809/0