Skip to content

Commit fc4151b

Browse files
committed
C++17 features
1 parent 5cbf953 commit fc4151b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

gframe/irrUString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ class ustring16 {
449449
//! Returns the length of a ustring16 in full characters.
450450
//! \return Length of a ustring16 in full characters.
451451
u32 size() const {
452-
if (sizeof(wchar_t) == 4) {
452+
if constexpr (sizeof(wchar_t) == 4) {
453453
return size_raw_;
454454
} else {
455455
if(size_ != 0xffffffff)
@@ -524,7 +524,7 @@ class ustring16 {
524524
//! \return A reference to our current string.
525525
void validate() {
526526
// Validate all unicode characters.
527-
if (sizeof(wchar_t) == 4) {
527+
if constexpr (sizeof(wchar_t) == 4) {
528528
size_ = size_raw_;
529529
return;
530530
}

gframe/network.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <event2/thread.h>
1111
#include <type_traits>
1212

13-
#define check_trivially_copyable(T) static_assert(std::is_trivially_copyable<T>::value == true && std::is_standard_layout<T>::value == true, "not trivially copyable")
13+
#define check_trivially_copyable(T) static_assert(std::is_trivially_copyable_v<T> == true && std::is_standard_layout_v<T> == true, "not trivially copyable")
1414

1515
namespace ygo {
1616
constexpr int SIZE_NETWORK_BUFFER = 0x20000;

0 commit comments

Comments
 (0)