diff options
-rw-r--r-- | yt/yt/core/ytree/yson_struct.cpp | 15 | ||||
-rw-r--r-- | yt/yt/core/ytree/yson_struct.h | 7 |
2 files changed, 17 insertions, 5 deletions
diff --git a/yt/yt/core/ytree/yson_struct.cpp b/yt/yt/core/ytree/yson_struct.cpp index 53b875c2e7..42983a33a9 100644 --- a/yt/yt/core/ytree/yson_struct.cpp +++ b/yt/yt/core/ytree/yson_struct.cpp @@ -7,6 +7,8 @@ #include <util/generic/algorithm.h> +#include <util/system/platform.h> + namespace NYT::NYTree { using namespace NYPath; @@ -18,6 +20,19 @@ TYsonStructFinalClassHolder::TYsonStructFinalClassHolder(std::type_index typeInd : FinalType_(typeIndex) { } +#ifdef _win_ + +// This constructor is not actually called. +// This dummy implementation is only provided for MSVC +// as the latter fails to link the binary in debug mode unless it is implemented. +// If we just delete it, the default constructor of TYsonStructLite +// will be implicitly deleted as well and compilation will fail. +TYsonStructFinalClassHolder::TYsonStructFinalClassHolder() + : FinalType_{typeid(void)} +{ } + +#endif + //////////////////////////////////////////////////////////////////////////////// TYsonStructBase::TYsonStructBase() diff --git a/yt/yt/core/ytree/yson_struct.h b/yt/yt/core/ytree/yson_struct.h index 4d917baf7a..84be291e8f 100644 --- a/yt/yt/core/ytree/yson_struct.h +++ b/yt/yt/core/ytree/yson_struct.h @@ -162,13 +162,10 @@ private: class TYsonStructFinalClassHolder { protected: - explicit TYsonStructFinalClassHolder(std::type_index typeIndex); + std::type_index FinalType_; - // This constructor is only declared but not defined as it never is called. - // If we delete it default constructor of TYsonStructLite will be implicitly deleted as well and compilation will fail. + explicit TYsonStructFinalClassHolder(std::type_index typeIndex); TYsonStructFinalClassHolder(); - - std::type_index FinalType_; }; //////////////////////////////////////////////////////////////////////////////// |