2016-08-01から1ヶ月間の記事一覧

boost::numeric::ublas::matrixのiterator

boostのublas::matrixにはbegin1とbegin2のiteratorがある。 どういうものか記載がなかったのでメモ。 答えは、行列の1行目と1列目のitetator namespace ublas = boost::numeric::ublas; ublas::matrix<double> m(3, 3); m(0, 0) = 0.0; m(0, 1) = 1.0; m(0, 2) = 2.</double>…

boostでdemangleする

C++

boost/coreにはいくつかのutility系の機能がある。 boost/core/demangle.hppはdemangleを提供する。 使い方 #include <boost/core/demangle.hpp> #include <typeinfo> #include <iostream> template<class T> struct X { }; int main() { char const * name = typeid( X<int> ).name(); std::cout << name << std::endl; </int></class></iostream></typeinfo></boost/core/demangle.hpp>…