skystrife / cpptoml

cpptoml is a header-only library for parsing TOML
MIT License
582 stars 133 forks source link

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 #65

Open benui-dev opened 6 years ago

benui-dev commented 6 years ago

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?

adah1972 commented 6 years ago

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

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

eternalphane commented 5 years ago

@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

gpravada commented 2 years ago

After this i am getting lot of errors.