skystrife / cpptoml

cpptoml is a header-only library for parsing TOML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cpptoml.h(570): error C2280: 'std::shared_ptr<cpptoml::value<double>> std::dynamic_pointer_cast<cpptoml::value<double>,cpptoml::base>(const std::shared_ptr<cpptoml::base> &) noexcept': attempting to reference a deleted function

benui-dev opened this issue · comments

commented

I'm trying to compile in Windows and I hit the following error:

cpptoml.h(570): error C2280: 'std::shared_ptr<cpptoml::value<double>> std::dynamic_pointer_cast<cpptoml::value<double>,cpptoml::base>(const std::shared_ptr<cpptoml::base> &) noexcept': attempting to reference a deleted function

Is there any solution?

You need to be more specific: test code, compiler used, etc.

FYI: I am using cpptoml without problems in Visual Studio 2017.

@bhumphreys Maybe you've disabled support for RTTI at compile-time:

#ifdef _CPPRTTI
// some other definition...
#else // _CPPRTTI
template <class _Ty1,
    class _Ty2>
shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>&) noexcept = delete; // requires /GR option
#endif // _CPPRTTI

see the comment requires /GR option

After this i am getting lot of errors.