私は次のコードをコンパイルしようとしています:
#include <iostream>
#include <iterator>
#include <vector>
#include <boost/assign/std/vector.hpp>
#include <boost/optional.hpp>
#include <boost/range/adaptor/indirected.hpp>
#include <boost/range/algorithm/copy.hpp>
int main( int argc, char ** argv )
{
using namespace boost::assign;
using boost::adaptors::indirected;
std::vector<boost::optional<unsigned> > values;
values += 1u,2u,3u;
boost::copy( values | indirected, std::ostream_iterator<unsigned>( std::cout, " " ) );
std::cout << std::endl;
}
element_type
ただし、で名前が付けられたタイプがないなど、いくつかのエラーが発生しましたboost::optional<unsigned>
。ただし、リファレンスページのページには、operator*()
単項関数の存在が唯一の前提条件であると記載されています。それを機能させる方法はありますか?