2013-08-27から1日間の記事一覧

渡された型のtemplate parametersを得るメタ関数2

先日の件を経てcv修飾に対応しました。 もっと賢い実装がありそうですが、constとvolatileならせいぜい2 * 2通りしかないので凝ったことせずにそのままSFINAEで対応。 #include <iostream> #include <typeinfo> #include <cxxabi.h> #include <type_traits> #include <boost/mpl/vector.hpp> template<class... Types> struct Foo; template<class T> str</class></class...></boost/mpl/vector.hpp></type_traits></cxxabi.h></typeinfo></iostream>…

std::is_sameとmpl::equal

結論 Twitterで何人かの方に教えていただきました。 typeidがトップレベルのcv修飾や参照を無視するので、それをデマングルするとその部分だけが違う型は同じように表示されていました。 template<template<class...> class Type, class... Args> static const boost::mpl::vect</template<class...>…