次のことを移植可能に行うことは可能ですか:
struct structure {
structure() {}
private:
// only allow container copy construct
structure(const structure&) {}
// in general, does not work because allocator (not vector) calls copy construct
friend class std::vector<structure>;
};
上記のコンパイルを試みるメッセージの例:
In member function void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const _Tp&)
[with _Tp = kernel_data<const double*>::block]:
...
/usr/include/c++/4.3/ext/new_allocator.h:108: error: within this context
ありがとう
回避策はありますが、これがどのように可能になるのか興味があります