From 459a654fb1f2469b722469d338cb138fcc18117b Mon Sep 17 00:00:00 2001 From: LeonardoIshida Date: Sat, 13 Dec 2025 17:21:58 -0300 Subject: [PATCH] Fix operator types --- CMakeLists.txt | 2 +- include/type_safe/types.hpp | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 421ce0f..cc0baaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # This file is subject to the license terms in the LICENSE file # found in the top-level directory of this distribution. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(TYPE_SAFE) diff --git a/include/type_safe/types.hpp b/include/type_safe/types.hpp index 1f6087b..fcd81c3 100644 --- a/include/type_safe/types.hpp +++ b/include/type_safe/types.hpp @@ -81,56 +81,56 @@ inline namespace types { /// \module types template - constexpr int8_t operator"" _i8() + constexpr int8_t operator""_i8() { return int8_t(detail::parse_signed()); } /// \module types template - constexpr int16_t operator"" _i16() + constexpr int16_t operator""_i16() { return int16_t(detail::parse_signed()); } /// \module types template - constexpr int32_t operator"" _i32() + constexpr int32_t operator""_i32() { return int32_t(detail::parse_signed()); } /// \module types template - constexpr int64_t operator"" _i64() + constexpr int64_t operator""_i64() { return int64_t(detail::parse_signed()); } /// \module types template - constexpr uint8_t operator"" _u8() + constexpr uint8_t operator""_u8() { return uint8_t(detail::parse_unsigned()); } /// \module types template - constexpr uint16_t operator"" _u16() + constexpr uint16_t operator""_u16() { return uint16_t(detail::parse_unsigned()); } /// \module types template - constexpr uint32_t operator"" _u32() + constexpr uint32_t operator""_u32() { return uint32_t(detail::parse_unsigned()); } /// \module types template - constexpr uint64_t operator"" _u64() + constexpr uint64_t operator""_u64() { return uint64_t(detail::parse_unsigned()); } @@ -194,21 +194,21 @@ inline namespace types { /// \module types template - constexpr ptrdiff_t operator"" _isize() + constexpr ptrdiff_t operator""_isize() { return ptrdiff_t(detail::parse_signed()); } /// \module types template - constexpr size_t operator"" _usize() + constexpr size_t operator""_usize() { return size_t(detail::parse_unsigned()); } /// \module types template - constexpr int_t operator"" _i() + constexpr int_t operator""_i() { // int is at least 16 bits return int_t(detail::parse_signed()); @@ -216,7 +216,7 @@ inline namespace types /// \module types template - constexpr unsigned_t operator"" _u() + constexpr unsigned_t operator""_u() { // int is at least 16 bits return unsigned_t(detail::parse_unsigned()); @@ -232,13 +232,13 @@ inline namespace types inline namespace literals { /// \module types - constexpr float_t operator"" _f(long double val) + constexpr float_t operator""_f(long double val) { return float_t(static_cast(val)); } /// \module types - constexpr double_t operator"" _d(long double val) + constexpr double_t operator""_d(long double val) { return double_t(static_cast(val)); }