Skip to content

Commit dbb05c0

Browse files
author
nitrocaster
committed
Use final specifier instead of make_final, update type_traits.
1 parent 68ccea9 commit dbb05c0

34 files changed

+50
-252
lines changed

src/common/object_loader.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
10+
#include <type_traits>
1011

1112
template <class M, typename P>
1213
struct CLoader {
@@ -16,7 +17,7 @@ struct CLoader {
1617
template <bool a>
1718
IC static void load_data(T &data, M &stream, const P &p)
1819
{
19-
STATIC_CHECK (!is_polymorphic<T>::result,Cannot_load_polymorphic_classes_as_binary_data);
20+
STATIC_CHECK (!std::is_polymorphic<T>::value,Cannot_load_polymorphic_classes_as_binary_data);
2021
stream.r (&data,sizeof(T));
2122
}
2223

src/common/object_saver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
10+
#include <type_traits>
1011

1112
template <class M, typename P>
1213
struct CSaver {
@@ -16,7 +17,7 @@ struct CSaver {
1617
template <bool a>
1718
IC static void save_data(const T &data, M &stream, const P &p)
1819
{
19-
STATIC_CHECK (!is_polymorphic<T>::result,Cannot_save_polymorphic_classes_as_binary_data);
20+
STATIC_CHECK (!std::is_polymorphic<T>::value,Cannot_save_polymorphic_classes_as_binary_data);
2021
stream.w (&data,sizeof(T));
2122
}
2223

src/common/object_type_traits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@
154154

155155
enum {
156156
value =
157-
is_class<T1>::result &&
158-
is_class<T2>::result &&
157+
std::is_class<T1>::value &&
158+
std::is_class<T2>::value &&
159159
!is_same<T1,T2>::value &&
160160
sizeof(detail::yes) == sizeof(select((T2*)(0)))
161161
};

src/xrCDB/StdAfx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ IC void cdelete (T* &ptr)
5454
{
5555
if (ptr)
5656
{
57-
cspecial_free<is_polymorphic<T>::result,T>()(ptr);
57+
cspecial_free<std::is_polymorphic<T>::value,T>()(ptr);
5858
ptr = NULL;
5959
}
6060
}

src/xrCore/_stl_extensions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using std::swap;
55

6-
#include "_type_traits.h"
7-
86
#ifdef __BORLANDC__
97
#define M_NOSTDCONTAINERS_EXT
108
#endif

src/xrCore/_type_traits.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/xrCore/xrCore.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@
533533
<ClInclude Include="_std_extensions.h" />
534534
<ClInclude Include="_stl_extensions.h" />
535535
<ClInclude Include="_types.h" />
536-
<ClInclude Include="_type_traits.h" />
537536
<ClInclude Include="_vector2.h" />
538537
<ClInclude Include="_vector3d.h" />
539538
<ClInclude Include="_vector3d_ext.h" />

src/xrCore/xrCore.vcxproj.filters

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,6 @@
479479
<ClInclude Include="_stl_extensions.h">
480480
<Filter>Math\Extensions</Filter>
481481
</ClInclude>
482-
<ClInclude Include="_type_traits.h">
483-
<Filter>Math\Extensions</Filter>
484-
</ClInclude>
485482
<ClInclude Include="clsid.h">
486483
<Filter>Math\Extensions</Filter>
487484
</ClInclude>

src/xrCore/xrMemory_subst_msvc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ IC void xr_delete(T*& ptr)
168168
{
169169
if (ptr)
170170
{
171-
xr_special_free<is_polymorphic<T>::result, T>()(ptr);
171+
xr_special_free<std::is_polymorphic<T>::value, T>()(ptr);
172172
ptr = NULL;
173173
}
174174
}
@@ -177,7 +177,7 @@ IC void xr_delete(T* const& ptr)
177177
{
178178
if (ptr)
179179
{
180-
xr_special_free<is_polymorphic<T>::result, T>(ptr);
180+
xr_special_free<std::is_polymorphic<T>::value, T>(ptr);
181181
const_cast<T*&>(ptr) = NULL;
182182
}
183183
}

src/xrGame/cover_manager.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ namespace smart_cover {
163163
void CCoverManager::remove_nearby_covers (smart_cover::cover const &cover, smart_cover::object const &object) const
164164
{
165165
m_nearest.clear ();
166-
typedef smart_cover::description::Loopholes::const_iterator const_iterator;
167-
const_iterator I = cover.loopholes().begin();
168-
const_iterator E = cover.loopholes().end();
169-
for ( ; I != E; ++I ) {
170-
Fvector position = cover.fov_position(**I);
166+
for (const smart_cover::loophole *loophole : cover.loopholes())
167+
{
168+
Fvector position = cover.fov_position(*loophole);
171169
m_covers->nearest (position, object.Radius() + 1.f, m_nearest);
172170

173171
m_nearest.erase(

0 commit comments

Comments
 (0)