Код: Выделить всё
#include
#include
#include
#include
#include
#include
using namespace boost::type_erasure;
struct _x : placeholder {};
class abstract_printer2 {
public:
template
void print(X x) const {
tuple args(x);
do_print(get(args));
}
virtual ~abstract_printer2() {}
protected:
typedef boost::mpl::vector<
ostreamable
> requirements;
typedef boost::type_erasure::any x_type;
virtual void do_print(x_type x) const = 0;
};
class separator_printer2 : public abstract_printer2 {
protected:
virtual void do_print(x_type x) const {
std::cout
Build started at 14:02...
1>------ Build started: Project: test, Configuration: Debug x64 ------
1>test.cpp
1>C:\bob\projects\test\test.cpp(17,17): error C2280: 'boost::type_erasure::any::any(const boost::type_erasure::any &)': attempting to reference a deleted function
1>C:\bob\projects\boost\boost\type_erasure\any.hpp(1928,1):
1>compiler has generated 'boost::type_erasure::any::any' here
1>C:\bob\projects\boost\boost\type_erasure\any.hpp(1928,1):
1>'boost::type_erasure::any::any(const boost::type_erasure::any &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'boost::type_erasure::any_constructor_control::any_constructor_control(const boost::type_erasure::any_constructor_control &)'
1> with
1> [
1> Concept=abstract_printer2::requirements,
1> T=_x
1> ]
1>C:\bob\projects\boost\boost\type_erasure\any.hpp(376,5):
1>'boost::type_erasure::any_constructor_control::any_constructor_control(const boost::type_erasure::any_constructor_control &)': function was explicitly deleted
1> with
1> [
1> Concept=abstract_printer2::requirements,
1> T=_x
1> ]
1>C:\bob\projects\test\test.cpp(17,17):
1>the template instantiation context (the oldest one first) is
1> C:\bob\projects\test\test.06.factory\test.cpp(38,7):
1> see reference to function template instantiation 'void abstract_printer2::print(X) const' being compiled
1> with
1> [
1> X=int
1> ]
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 14:02 and took 01.517 seconds ==========
Подробнее здесь: https://stackoverflow.com/questions/793 ... ypeerasure