#include #include #include // A class, which must not be used as base class (e.g. because the destructor is not // virtual). class Foo final{ public: template void serialize(ArchiveType& rArchive,const unsigned int Version){ } }; void main(){ // Create an instance of Foo Foo Instance; // Serialize it to a text archive std::fstream OutputFile("OutputFile.txt"); if(OutputFile.is_open()){ boost::archive::text_oarchive OutputArchive(OutputFile); // Templates instantiated due to the next line cause the following error, // when compiling with Visual Studio 2012 SP1: // [...]boost\type_traits\is_polymorphic.hpp(46): error C3246: // 'boost::detail::is_polymorphic_imp1::d2' : cannot inherit from 'Foo' // as it has been declared as 'final' OutputArchive<