Visual Studio 2012で書かれたライブラリをコンパイルしようとしていましたC++で。 'クラス'のタグがありませんというエラーがあります。コンパイルエラー表示されているクラスのエラーMSG template <class ... Args> void operator()(Args && ... args)コンパイルエラー "Class"にタグがありません
コードの
画面を撮影。
template <class T>
class construct
{
public:
template <class ... Args>
void operator()(Args && ... args);
T * operator->()
{
if(!itsValid)
throw Exception("Object must be initialized prior to accessing members");
return itsPtr;
}
T * ptr()
{
return operator->();
}
private:
template <class A, class B> friend struct ::cereal::memory_detail::LoadAndConstructLoadWrapper;
construct(T * p) : itsPtr(p), itsValid(false) {}
construct(construct const &) = delete;
construct & operator=(construct const &) = delete;
T * itsPtr;
bool itsValid;
};
この問題は、異なるバージョンのC++コンパイラによって発生する可能性があります。 Visual Studio 2012はC++ 0xを使用し、Visual Studio 2015はC++ 11を使用します。
どのようにそれをコンパイルする方法Visual Studio 2012は非常に高く評価されます。
C++ 11の実装は、VS2012ではほとんど使用されず、VS2013ではほとんど使用できません。一般的にバックポーティングのC++ 11コードは、シシフェンのタスクです。 [この質問/回答](http://stackoverflow.com/questions/13238408/variadic-template-in-vs-2012-visual-c-november-2012-ctp)でも助けになるかもしれません。 –