From 79af939522da622a85a513747890e5221be1ae4f Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sat, 15 Oct 2016 22:30:58 +0100 Subject: Update ImplicitValue "architecture" --- src/string.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index e15498cd1..a8e8b5583 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -115,17 +115,17 @@ GB_COMPARE_PROC(string_cmp_proc) { } -bool operator ==(String a, String b) { return are_strings_equal(a, b) != 0; } -bool operator !=(String a, String b) { return !operator==(a, b); } -bool operator < (String a, String b) { return string_compare(a, b) < 0; } -bool operator > (String a, String b) { return string_compare(a, b) > 0; } -bool operator <=(String a, String b) { return string_compare(a, b) <= 0; } -bool operator >=(String a, String b) { return string_compare(a, b) >= 0; } - -template bool operator ==(String a, char const (&b)[N]) { return a == make_string(b); } -template bool operator !=(String a, char const (&b)[N]) { return a != make_string(b); } -template bool operator ==(char const (&a)[N], String b) { return make_string(a) == b; } -template bool operator !=(char const (&a)[N], String b) { return make_string(a) != b; } +gb_inline bool operator ==(String a, String b) { return are_strings_equal(a, b) != 0; } +gb_inline bool operator !=(String a, String b) { return !operator==(a, b); } +gb_inline bool operator < (String a, String b) { return string_compare(a, b) < 0; } +gb_inline bool operator > (String a, String b) { return string_compare(a, b) > 0; } +gb_inline bool operator <=(String a, String b) { return string_compare(a, b) <= 0; } +gb_inline bool operator >=(String a, String b) { return string_compare(a, b) >= 0; } + +template gb_inline bool operator ==(String a, char const (&b)[N]) { return a == make_string(cast(u8 *)b, N-1); } +template gb_inline bool operator !=(String a, char const (&b)[N]) { return a != make_string(cast(u8 *)b, N-1); } +template gb_inline bool operator ==(char const (&a)[N], String b) { return make_string(cast(u8 *)a, N-1) == b; } +template gb_inline bool operator !=(char const (&a)[N], String b) { return make_string(cast(u8 *)a, N-1) != b; } -- cgit v1.2.3