From dbb05c087d9b2a37725d91ac23bb02d5363ccf4c Mon Sep 17 00:00:00 2001 From: nitrocaster Date: Wed, 4 Nov 2015 00:24:19 +0300 Subject: [PATCH] Use final specifier instead of make_final, update type_traits. --- src/common/object_loader.h | 3 +- src/common/object_saver.h | 3 +- src/common/object_type_traits.h | 4 +- src/xrCDB/StdAfx.h | 2 +- src/xrCore/_stl_extensions.h | 2 - src/xrCore/_type_traits.h | 62 ------------------- src/xrCore/xrCore.vcxproj | 1 - src/xrCore/xrCore.vcxproj.filters | 3 - src/xrCore/xrMemory_subst_msvc.h | 4 +- src/xrGame/cover_manager.cpp | 8 +-- src/xrGame/debug_make_final.hpp | 44 ------------- src/xrGame/debug_make_final_test.cpp | 28 --------- src/xrGame/smart_cover.h | 3 +- src/xrGame/smart_cover_action.h | 5 +- src/xrGame/smart_cover_animation_planner.h | 6 +- src/xrGame/smart_cover_animation_selector.h | 4 +- .../smart_cover_default_behaviour_planner.hpp | 6 +- src/xrGame/smart_cover_description.h | 4 +- src/xrGame/smart_cover_loophole.h | 4 +- .../smart_cover_loophole_planner_actions.h | 12 +--- src/xrGame/smart_cover_planner_actions.h | 13 +--- .../smart_cover_planner_target_provider.h | 13 ++-- .../smart_cover_planner_target_selector.h | 6 +- src/xrGame/smart_cover_storage.h | 4 +- src/xrGame/smart_cover_transition.hpp | 8 +-- .../smart_cover_transition_animation.hpp | 6 +- src/xrGame/static_cast_checked.hpp | 8 +-- src/xrGame/steering_behaviour_alignment.h | 5 +- src/xrGame/steering_behaviour_cohesion.h | 3 +- src/xrGame/steering_behaviour_separation.h | 3 +- src/xrGame/xrGame.vcxproj | 4 -- src/xrGame/xrGame.vcxproj.filters | 9 --- src/xrServerEntities/smart_cast_impl0.h | 1 - src/xrServerEntities/smart_cast_impl1.h | 11 ++-- 34 files changed, 50 insertions(+), 252 deletions(-) delete mode 100644 src/xrCore/_type_traits.h delete mode 100644 src/xrGame/debug_make_final.hpp delete mode 100644 src/xrGame/debug_make_final_test.cpp diff --git a/src/common/object_loader.h b/src/common/object_loader.h index 3f42b1f25f5..2c0f0fa68a8 100644 --- a/src/common/object_loader.h +++ b/src/common/object_loader.h @@ -7,6 +7,7 @@ //////////////////////////////////////////////////////////////////////////// #pragma once +#include template struct CLoader { @@ -16,7 +17,7 @@ struct CLoader { template IC static void load_data(T &data, M &stream, const P &p) { - STATIC_CHECK (!is_polymorphic::result,Cannot_load_polymorphic_classes_as_binary_data); + STATIC_CHECK (!std::is_polymorphic::value,Cannot_load_polymorphic_classes_as_binary_data); stream.r (&data,sizeof(T)); } diff --git a/src/common/object_saver.h b/src/common/object_saver.h index d6a7769b906..d6cfcfcbc72 100644 --- a/src/common/object_saver.h +++ b/src/common/object_saver.h @@ -7,6 +7,7 @@ //////////////////////////////////////////////////////////////////////////// #pragma once +#include template struct CSaver { @@ -16,7 +17,7 @@ struct CSaver { template IC static void save_data(const T &data, M &stream, const P &p) { - STATIC_CHECK (!is_polymorphic::result,Cannot_save_polymorphic_classes_as_binary_data); + STATIC_CHECK (!std::is_polymorphic::value,Cannot_save_polymorphic_classes_as_binary_data); stream.w (&data,sizeof(T)); } diff --git a/src/common/object_type_traits.h b/src/common/object_type_traits.h index 30fe90e3b51..7ed0bac789d 100644 --- a/src/common/object_type_traits.h +++ b/src/common/object_type_traits.h @@ -154,8 +154,8 @@ enum { value = - is_class::result && - is_class::result && + std::is_class::value && + std::is_class::value && !is_same::value && sizeof(detail::yes) == sizeof(select((T2*)(0))) }; diff --git a/src/xrCDB/StdAfx.h b/src/xrCDB/StdAfx.h index 9a3bebbeb72..0ecf0779754 100644 --- a/src/xrCDB/StdAfx.h +++ b/src/xrCDB/StdAfx.h @@ -54,7 +54,7 @@ IC void cdelete (T* &ptr) { if (ptr) { - cspecial_free::result,T>()(ptr); + cspecial_free::value,T>()(ptr); ptr = NULL; } } diff --git a/src/xrCore/_stl_extensions.h b/src/xrCore/_stl_extensions.h index 93a140695d9..8ee18076dad 100644 --- a/src/xrCore/_stl_extensions.h +++ b/src/xrCore/_stl_extensions.h @@ -3,8 +3,6 @@ using std::swap; -#include "_type_traits.h" - #ifdef __BORLANDC__ #define M_NOSTDCONTAINERS_EXT #endif diff --git a/src/xrCore/_type_traits.h b/src/xrCore/_type_traits.h deleted file mode 100644 index da8b0bc4315..00000000000 --- a/src/xrCore/_type_traits.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _STL_EXT_type_traits -#define _STL_EXT_type_traits -#pragma once - -// 1. class or not class -template -struct is_class -{ - struct _yes { char _a[1]; }; - struct _no { char _a[2]; }; - - template static _yes is_class_tester(void(U::*)(void)); - template static _no is_class_tester(...); - - enum { result = (sizeof(_yes) == sizeof(is_class_tester(0))) }; -}; - -// 2. is polymorphic (class) -template -struct is_pm_class -{ - struct c1 : public T - { - char padding[16]; - c1(); - c1(const c1&); - c1& operator=(const c1&); - }; - struct c2 : public T - { - char padding[16]; - c2(); - c2(const c2&); - c2& operator=(const c2&); - virtual ~c2(); - }; - enum { result = (sizeof(c1) == sizeof(c2)) }; -}; - -// 3. select result based on class/not class -template -struct is_pm_classify -{ - template - struct _detail { enum { result = is_pm_class<_T>::result }; }; -}; -template<> -struct is_pm_classify < false > -{ - template - struct _detail { enum { result = false }; }; -}; -template -struct is_polymorphic -{ - enum - { - result = is_pm_classify::result> ::_detail ::result - }; -}; - -#endif diff --git a/src/xrCore/xrCore.vcxproj b/src/xrCore/xrCore.vcxproj index 0b5a91dc96d..3f46810c8a6 100644 --- a/src/xrCore/xrCore.vcxproj +++ b/src/xrCore/xrCore.vcxproj @@ -533,7 +533,6 @@ - diff --git a/src/xrCore/xrCore.vcxproj.filters b/src/xrCore/xrCore.vcxproj.filters index 72990e0529e..2e91ed19069 100644 --- a/src/xrCore/xrCore.vcxproj.filters +++ b/src/xrCore/xrCore.vcxproj.filters @@ -479,9 +479,6 @@ Math\Extensions - - Math\Extensions - Math\Extensions diff --git a/src/xrCore/xrMemory_subst_msvc.h b/src/xrCore/xrMemory_subst_msvc.h index 9d35581f145..b015190780e 100644 --- a/src/xrCore/xrMemory_subst_msvc.h +++ b/src/xrCore/xrMemory_subst_msvc.h @@ -168,7 +168,7 @@ IC void xr_delete(T*& ptr) { if (ptr) { - xr_special_free::result, T>()(ptr); + xr_special_free::value, T>()(ptr); ptr = NULL; } } @@ -177,7 +177,7 @@ IC void xr_delete(T* const& ptr) { if (ptr) { - xr_special_free::result, T>(ptr); + xr_special_free::value, T>(ptr); const_cast(ptr) = NULL; } } diff --git a/src/xrGame/cover_manager.cpp b/src/xrGame/cover_manager.cpp index 737f921bbc3..5e0351bb0f9 100644 --- a/src/xrGame/cover_manager.cpp +++ b/src/xrGame/cover_manager.cpp @@ -163,11 +163,9 @@ namespace smart_cover { void CCoverManager::remove_nearby_covers (smart_cover::cover const &cover, smart_cover::object const &object) const { m_nearest.clear (); - typedef smart_cover::description::Loopholes::const_iterator const_iterator; - const_iterator I = cover.loopholes().begin(); - const_iterator E = cover.loopholes().end(); - for ( ; I != E; ++I ) { - Fvector position = cover.fov_position(**I); + for (const smart_cover::loophole *loophole : cover.loopholes()) + { + Fvector position = cover.fov_position(*loophole); m_covers->nearest (position, object.Radius() + 1.f, m_nearest); m_nearest.erase( diff --git a/src/xrGame/debug_make_final.hpp b/src/xrGame/debug_make_final.hpp deleted file mode 100644 index 285bebbaff2..00000000000 --- a/src/xrGame/debug_make_final.hpp +++ /dev/null @@ -1,44 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : debug_make_final.hpp -// Created : 03.12.2007 -// Modified : 04.12.2007 -// Author : Dmitriy Iassenev -// Description : make_final class for debug purposes -//////////////////////////////////////////////////////////////////////////// - -#ifndef DEBUG_MAKE_FINAL_HPP_INCLUDED -#define DEBUG_MAKE_FINAL_HPP_INCLUDED - -#include - -namespace debug { - -#ifdef DEBUG - namespace detail { - - template - class make_final { - make_final () {} - friend T1; - friend T2; - }; // class make_final - - } // namespace detail - - template - struct make_final : - private virtual - detail::make_final< - T, - make_final - > - { - }; // class make_final -#else // DEBUG - template - class make_final {}; -#endif // DEBUG - -} // namespace debug - -#endif // DEBUG_MAKE_FINAL_HPP_INCLUDED \ No newline at end of file diff --git a/src/xrGame/debug_make_final_test.cpp b/src/xrGame/debug_make_final_test.cpp deleted file mode 100644 index 5331f5c9648..00000000000 --- a/src/xrGame/debug_make_final_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : debug_make_final.cpp -// Created : 03.12.2007 -// Modified : 04.12.2007 -// Author : Dmitriy Iassenev -// Description : make_final class for debug purposes -//////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "debug_make_final.hpp" - -struct A : private boost::noncopyable -{ -}; - -struct B : - public A, - private debug::make_final -{ -}; - -struct C : B {}; - -B b; - -// the next 2 lines won't compile -C *c0 = new C(); -C c1; \ No newline at end of file diff --git a/src/xrGame/smart_cover.h b/src/xrGame/smart_cover.h index fca5b9a5a47..34c2d764ea3 100644 --- a/src/xrGame/smart_cover.h +++ b/src/xrGame/smart_cover.h @@ -26,9 +26,8 @@ struct loophole_data { u32 m_level_vertex_id; }; -class cover : +class cover final : public CCoverPoint, - private debug::make_final, private boost::noncopyable { public: diff --git a/src/xrGame/smart_cover_action.h b/src/xrGame/smart_cover_action.h index aceb77e628a..6d1043ef117 100644 --- a/src/xrGame/smart_cover_action.h +++ b/src/xrGame/smart_cover_action.h @@ -13,13 +13,10 @@ #include "xrScriptEngine/script_space_forward.hpp" #include "ai_monster_space.h" #include "xrCore/Containers/AssociativeVector.hpp" -#include "debug_make_final.hpp" namespace smart_cover{ -class action : - private debug::make_final, - private boost::noncopyable +class action final : private boost::noncopyable { private: class animation_predicate { diff --git a/src/xrGame/smart_cover_animation_planner.h b/src/xrGame/smart_cover_animation_planner.h index 057fa99671d..73c712ba3a1 100644 --- a/src/xrGame/smart_cover_animation_planner.h +++ b/src/xrGame/smart_cover_animation_planner.h @@ -12,7 +12,6 @@ #include "smart_cover_detail.h" #include "action_planner_script.h" #include "stalker_decision_space.h" -#include "debug_make_final.hpp" class CAI_Stalker; struct SHit; @@ -23,10 +22,9 @@ namespace smart_cover { class cover; class target_selector; -class animation_planner : +class animation_planner final : public CActionPlannerScript, - private boost::noncopyable, - private debug::make_final + private boost::noncopyable { private: typedef CActionPlannerScript inherited; diff --git a/src/xrGame/smart_cover_animation_selector.h b/src/xrGame/smart_cover_animation_selector.h index 2c4e64e9145..6adffde2fb0 100644 --- a/src/xrGame/smart_cover_animation_selector.h +++ b/src/xrGame/smart_cover_animation_selector.h @@ -24,9 +24,7 @@ namespace smart_cover { class action_base; class wait_after_exit; -class animation_selector : - private boost::noncopyable, - private debug::make_final +class animation_selector final : private boost::noncopyable { private: CPropertyStorage *m_storage; diff --git a/src/xrGame/smart_cover_default_behaviour_planner.hpp b/src/xrGame/smart_cover_default_behaviour_planner.hpp index 63d5bab7cef..875155cb0e3 100644 --- a/src/xrGame/smart_cover_default_behaviour_planner.hpp +++ b/src/xrGame/smart_cover_default_behaviour_planner.hpp @@ -11,16 +11,14 @@ #include #include "smart_cover_detail.h" #include "action_planner_action.h" -#include "debug_make_final.hpp" namespace smart_cover { class animation_planner; -class default_behaviour_planner : +class default_behaviour_planner final : public CActionPlannerAction, - private boost::noncopyable, - private debug::make_final + private boost::noncopyable { private: typedef CActionPlannerAction inherited; diff --git a/src/xrGame/smart_cover_description.h b/src/xrGame/smart_cover_description.h index f8a660bd1b7..91b5afe2cc9 100644 --- a/src/xrGame/smart_cover_description.h +++ b/src/xrGame/smart_cover_description.h @@ -11,7 +11,6 @@ #include #include "smart_cover_detail.h" #include "graph_abstract.h" -#include "debug_make_final.hpp" namespace smart_cover { @@ -22,8 +21,7 @@ namespace transitions { class action; } -class description : - private debug::make_final, +class description final : private boost::noncopyable, public detail::intrusive_base_time { diff --git a/src/xrGame/smart_cover_loophole.h b/src/xrGame/smart_cover_loophole.h index ffc01f5e788..faaac9b9906 100644 --- a/src/xrGame/smart_cover_loophole.h +++ b/src/xrGame/smart_cover_loophole.h @@ -19,9 +19,7 @@ namespace smart_cover { class object; -class loophole : - private debug::make_final, - private boost::noncopyable +class loophole final : private boost::noncopyable { private: class action_predicate { diff --git a/src/xrGame/smart_cover_loophole_planner_actions.h b/src/xrGame/smart_cover_loophole_planner_actions.h index 7cc2424254e..682ab2ea14c 100644 --- a/src/xrGame/smart_cover_loophole_planner_actions.h +++ b/src/xrGame/smart_cover_loophole_planner_actions.h @@ -74,9 +74,7 @@ class loophole_action_no_sight : public loophole_action { virtual void finalize (); }; // class loophole_action_no_sight -class loophole_lookout : - public loophole_action, - private debug::make_final +class loophole_lookout final : public loophole_action { private: typedef loophole_action inherited; @@ -88,9 +86,7 @@ class loophole_lookout : virtual void finalize (); }; -class loophole_fire : - public loophole_action, - private debug::make_final +class loophole_fire final : public loophole_action { private: typedef loophole_action inherited; @@ -110,9 +106,7 @@ class loophole_fire : virtual void on_no_mark (); }; -class loophole_reload : - public loophole_action_no_sight, - private debug::make_final +class loophole_reload final : public loophole_action_no_sight { private: typedef loophole_action_no_sight inherited; diff --git a/src/xrGame/smart_cover_planner_actions.h b/src/xrGame/smart_cover_planner_actions.h index 06e609733eb..e4689e49fce 100644 --- a/src/xrGame/smart_cover_planner_actions.h +++ b/src/xrGame/smart_cover_planner_actions.h @@ -11,7 +11,6 @@ #include "smart_cover_detail.h" #include #include "stalker_combat_action_base.h" -#include "debug_make_final.hpp" class CAI_Stalker; @@ -44,9 +43,7 @@ class action_base : // change_loophole //////////////////////////////////////////////////////////////////////////// -class change_loophole : - public action_base, - private debug::make_final +class change_loophole final : public action_base { private: typedef action_base inherited; @@ -64,9 +61,7 @@ class change_loophole : // non_animated_change_loophole //////////////////////////////////////////////////////////////////////////// -class non_animated_change_loophole: - public action_base, - private debug::make_final +class non_animated_change_loophole final : public action_base { private: typedef action_base inherited; @@ -85,9 +80,7 @@ class non_animated_change_loophole: // exit //////////////////////////////////////////////////////////////////////////// -class exit : - public action_base, - private debug::make_final +class exit final : public action_base { private: typedef action_base inherited; diff --git a/src/xrGame/smart_cover_planner_target_provider.h b/src/xrGame/smart_cover_planner_target_provider.h index d896e7fe0ee..916e9b20e18 100644 --- a/src/xrGame/smart_cover_planner_target_provider.h +++ b/src/xrGame/smart_cover_planner_target_provider.h @@ -38,9 +38,8 @@ class target_provider : // class target_idle //////////////////////////////////////////////////////////////////////////// -class target_idle : - public target_provider, - private debug::make_final +class target_idle final : + public target_provider { private: typedef target_provider inherited; @@ -54,9 +53,7 @@ class target_idle : // class target_fire //////////////////////////////////////////////////////////////////////////// -class target_fire : - public target_provider, - private debug::make_final +class target_fire final : public target_provider { private: typedef target_provider inherited; @@ -71,9 +68,7 @@ class target_fire : // class target_fire_no_lookout //////////////////////////////////////////////////////////////////////////// -class target_fire_no_lookout : - public target_provider, - private debug::make_final +class target_fire_no_lookout final : public target_provider { private: typedef target_provider inherited; diff --git a/src/xrGame/smart_cover_planner_target_selector.h b/src/xrGame/smart_cover_planner_target_selector.h index e9a5ceb4971..31af83f753b 100644 --- a/src/xrGame/smart_cover_planner_target_selector.h +++ b/src/xrGame/smart_cover_planner_target_selector.h @@ -12,16 +12,14 @@ #include "smart_cover_detail.h" #include "action_planner_action.h" #include "script_callback_ex.h" -#include "debug_make_final.hpp" namespace smart_cover { class animation_planner; -class target_selector : +class target_selector final : public CActionPlannerAction, - private boost::noncopyable, - private debug::make_final + private boost::noncopyable { private: typedef CActionPlannerAction inherited; diff --git a/src/xrGame/smart_cover_storage.h b/src/xrGame/smart_cover_storage.h index c019ec2a4d4..85939380c3a 100644 --- a/src/xrGame/smart_cover_storage.h +++ b/src/xrGame/smart_cover_storage.h @@ -13,9 +13,7 @@ namespace smart_cover { -class storage : - private debug::make_final, - private boost::noncopyable +class storage final : private boost::noncopyable { public: typedef xr_vector Descriptions; diff --git a/src/xrGame/smart_cover_transition.hpp b/src/xrGame/smart_cover_transition.hpp index 929eab0131f..f84e47ebff0 100644 --- a/src/xrGame/smart_cover_transition.hpp +++ b/src/xrGame/smart_cover_transition.hpp @@ -7,8 +7,7 @@ #ifndef SMART_COVER_TRANSITION_HPP_INCLUDED #define SMART_COVER_TRANSITION_HPP_INCLUDED - -#include "debug_make_final.hpp" +#include namespace MonsterSpace { enum EBodyState; @@ -19,11 +18,8 @@ namespace transitions { class animation_action; -class action : - private debug::make_final, - private boost::noncopyable +class action final : private boost::noncopyable { - public: typedef xr_vector Animations; diff --git a/src/xrGame/smart_cover_transition_animation.hpp b/src/xrGame/smart_cover_transition_animation.hpp index 79c4c3f67f9..3c48fd72fc6 100644 --- a/src/xrGame/smart_cover_transition_animation.hpp +++ b/src/xrGame/smart_cover_transition_animation.hpp @@ -8,16 +8,14 @@ #ifndef SMART_COVER_TRANSITION_ANIMATION_HPP_INCLUDED #define SMART_COVER_TRANSITION_ANIMATION_HPP_INCLUDED -#include "debug_make_final.hpp" #include "ai_monster_space.h" +#include namespace smart_cover { namespace transitions { -class animation_action : - private debug::make_final, - private boost::noncopyable +class animation_action final : private boost::noncopyable { private: Fvector m_position; diff --git a/src/xrGame/static_cast_checked.hpp b/src/xrGame/static_cast_checked.hpp index 55e9f69abbb..bc61ba2c82d 100644 --- a/src/xrGame/static_cast_checked.hpp +++ b/src/xrGame/static_cast_checked.hpp @@ -61,9 +61,9 @@ inline destination_type static_cast_checked (source_type const & source) source_type const &, destination_type >::check< - is_polymorphic< + std::is_polymorphic< pure_source_type - >::result + >::value > (source); return (static_cast(source)); @@ -79,9 +79,9 @@ inline destination_type static_cast_checked (source_type & source) source_type &, destination_type >::check< - is_polymorphic< + std::is_polymorphic< pure_source_type - >::result + >::value > (source); return (static_cast(source)); diff --git a/src/xrGame/steering_behaviour_alignment.h b/src/xrGame/steering_behaviour_alignment.h index c8eae0b1be9..a57eb9be6c5 100644 --- a/src/xrGame/steering_behaviour_alignment.h +++ b/src/xrGame/steering_behaviour_alignment.h @@ -16,9 +16,8 @@ class CAI_Rat; namespace steering_behaviour { -class alignment : - public base, - private debug::make_final, +class alignment final : + public base, private boost::noncopyable { public: diff --git a/src/xrGame/steering_behaviour_cohesion.h b/src/xrGame/steering_behaviour_cohesion.h index 0a69ca77ef3..859e41bc3f2 100644 --- a/src/xrGame/steering_behaviour_cohesion.h +++ b/src/xrGame/steering_behaviour_cohesion.h @@ -16,9 +16,8 @@ class CAI_Rat; namespace steering_behaviour { -class cohesion : +class cohesion final : public base, - private debug::make_final, private boost::noncopyable { public: diff --git a/src/xrGame/steering_behaviour_separation.h b/src/xrGame/steering_behaviour_separation.h index f382f1050cb..aa7a4f9c4f4 100644 --- a/src/xrGame/steering_behaviour_separation.h +++ b/src/xrGame/steering_behaviour_separation.h @@ -16,9 +16,8 @@ class CAI_Rat; namespace steering_behaviour { -class separation : +class separation final : public base, - private debug::make_final, private boost::noncopyable { public: diff --git a/src/xrGame/xrGame.vcxproj b/src/xrGame/xrGame.vcxproj index d213e3c2b53..c79f815cc27 100644 --- a/src/xrGame/xrGame.vcxproj +++ b/src/xrGame/xrGame.vcxproj @@ -880,7 +880,6 @@ - @@ -2508,9 +2507,6 @@ - - true - diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index 17d7299be45..b56cd3cb956 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -1909,9 +1909,6 @@ {6f0684eb-522c-4fdd-903d-6954b0c0f4d4} - - {f3e4fd87-5386-4350-8c0f-fe6f9a823515} - {7cc45c9b-456f-485f-9228-1538d319dd8c} @@ -6054,9 +6051,6 @@ Core\Common\Registry - - Core\Common\debug\make_final - Core\Common\debug\static_cast_checked @@ -9554,9 +9548,6 @@ Core\Common\Registry - - Core\Common\debug\make_final - Core\Common\debug\static_cast_checked diff --git a/src/xrServerEntities/smart_cast_impl0.h b/src/xrServerEntities/smart_cast_impl0.h index 7127f617eb8..720966b5f29 100644 --- a/src/xrServerEntities/smart_cast_impl0.h +++ b/src/xrServerEntities/smart_cast_impl0.h @@ -8,7 +8,6 @@ #pragma once -#include "xrCore/_type_traits.h" #include "object_type_traits.h" namespace SmartDynamicCast { diff --git a/src/xrServerEntities/smart_cast_impl1.h b/src/xrServerEntities/smart_cast_impl1.h index 9a051c1bc74..9debbc4ed42 100644 --- a/src/xrServerEntities/smart_cast_impl1.h +++ b/src/xrServerEntities/smart_cast_impl1.h @@ -8,9 +8,6 @@ #pragma once -#include "xrCore/_type_traits.h" -#include "object_type_traits.h" - #ifdef DEBUG void add_smart_cast_stats (LPCSTR,LPCSTR); # ifdef SMART_CAST_STATS_ALL @@ -488,8 +485,8 @@ IC T1 smart_cast(T2* p) { #ifdef PURE_DYNAMIC_CAST_COMPATIBILITY_CHECK STATIC_CHECK (object_type_traits::is_pointer::value,Invalid_target_type_for_Dynamic_Cast); - STATIC_CHECK (object_type_traits::is_void::type>::value || is_polymorphic::type>::result,Invalid_target_type_for_Dynamic_Cast); - STATIC_CHECK (is_polymorphic::result,Invalid_source_type_for_Dynamic_Cast); + STATIC_CHECK (object_type_traits::is_void::type>::value || std::is_polymorphic::type>::value,Invalid_target_type_for_Dynamic_Cast); + STATIC_CHECK (std::is_polymorphic::value,Invalid_source_type_for_Dynamic_Cast); #endif #ifdef SMART_CAST_STATS_ALL add_smart_cast_stats_all (typeid(T2*).name(),typeid(T1).name()); @@ -504,8 +501,8 @@ IC T1 smart_cast(T2& p) { #ifdef PURE_DYNAMIC_CAST_COMPATIBILITY_CHECK STATIC_CHECK (object_type_traits::is_reference::value,Invalid_target_type_for_Dynamic_Cast); - STATIC_CHECK (is_polymorphic::type>::result,Invalid_target_type_for_Dynamic_Cast); - STATIC_CHECK (is_polymorphic::result,Invalid_source_type_for_Dynamic_Cast); + STATIC_CHECK (std::is_polymorphic::type>::value,Invalid_target_type_for_Dynamic_Cast); + STATIC_CHECK (std::is_polymorphic::value,Invalid_source_type_for_Dynamic_Cast); #endif #ifdef SMART_CAST_STATS_ALL add_smart_cast_stats_all (typeid(T2*).name(),typeid(object_type_traits::remove_reference::type*).name());