cpptoml icon indicating copy to clipboard operation
cpptoml copied to clipboard

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

Open benui-dev opened this issue 7 years ago • 3 comments

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?

benui-dev avatar Feb 22 '18 20:02 benui-dev

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

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

adah1972 avatar Mar 27 '18 05:03 adah1972

@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

eternalphane avatar Apr 19 '19 13:04 eternalphane

After this i am getting lot of errors.

gpravada avatar Nov 25 '21 13:11 gpravada