From 3fbf01b3466bb94a730cc94fea72ea661ffb9759 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 10 Apr 2025 11:14:28 -0400 Subject: pk.h: update to 0.4.7 --- src/pk.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/pk.h') diff --git a/src/pk.h b/src/pk.h index 587c05b..74b5a8d 100644 --- a/src/pk.h +++ b/src/pk.h @@ -1,7 +1,7 @@ #ifndef PK_SINGLE_HEADER_FILE_H #define PK_SINGLE_HEADER_FILE_H /******************************************************************************* -* PK Single-Header-Library V0.4.6 +* PK Single-Header-Library V0.4.7 * * Author: Jonathan Bradley * Copyright: © 2024-2025 Jonathan Bradley @@ -254,7 +254,7 @@ * *******************************************************************************/ -#define PK_VERSION "0.4.6" +#define PK_VERSION "0.4.7" #ifdef PK_IMPL_ALL # ifndef PK_IMPL_MEM_TYPES @@ -366,78 +366,78 @@ TypeName operator^=(TypeName& a, const TypeName& b); \ TypeName operator~(TypeName& a); #define TypeSafeInt2_B(TypeName, TypeName_T) \ - inline TypeName operator+(const TypeName& a, const TypeName& b) { \ + TypeName operator+(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) + static_cast(b)); \ } \ - inline TypeName operator-(const TypeName& a, const TypeName& b) { \ + TypeName operator-(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) - static_cast(b)); \ } \ - inline TypeName operator*(const TypeName& a, const TypeName& b) { \ + TypeName operator*(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) * static_cast(b)); \ } \ - inline TypeName operator/(const TypeName& a, const TypeName& b) { \ + TypeName operator/(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) / static_cast(b)); \ } \ - inline TypeName operator&(const TypeName& a, const TypeName& b) { \ + TypeName operator&(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) & static_cast(b)); \ } \ - inline TypeName operator|(const TypeName& a, const TypeName& b) { \ + TypeName operator|(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) | static_cast(b)); \ } \ - inline TypeName operator^(const TypeName& a, const TypeName& b) { \ + TypeName operator^(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) ^ static_cast(b)); \ } \ - inline TypeName& operator++(TypeName& a) { \ + TypeName& operator++(TypeName& a) { \ a = a + TypeName{1}; \ return a; \ } \ - inline TypeName& operator--(TypeName& a) { \ + TypeName& operator--(TypeName& a) { \ a = a - TypeName{1}; \ return a; \ }; \ - inline TypeName operator++(TypeName& a, int) { \ + TypeName operator++(TypeName& a, int) { \ a = a + TypeName{1}; \ return a; \ } \ - inline TypeName operator--(TypeName& a, int) { \ + TypeName operator--(TypeName& a, int) { \ a = a - TypeName{1}; \ return a; \ }; \ - inline TypeName operator<<(const TypeName& a, const TypeName& b) { \ + TypeName operator<<(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) << static_cast(b)); \ }; \ - inline TypeName operator>>(const TypeName& a, const TypeName& b) { \ + TypeName operator>>(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) >> static_cast(b)); \ }; \ - inline TypeName operator+=(TypeName& a, const TypeName& b) { \ + TypeName operator+=(TypeName& a, const TypeName& b) { \ a = TypeName{a + b}; \ return a; \ }; \ - inline TypeName operator-=(TypeName& a, const TypeName& b) { \ + TypeName operator-=(TypeName& a, const TypeName& b) { \ a = TypeName{a - b}; \ return a; \ }; \ - inline TypeName operator*=(TypeName& a, const TypeName& b) { \ + TypeName operator*=(TypeName& a, const TypeName& b) { \ a = TypeName{a * b}; \ return a; \ }; \ - inline TypeName operator/=(TypeName& a, const TypeName& b) { \ + TypeName operator/=(TypeName& a, const TypeName& b) { \ a = TypeName{a / b}; \ return a; \ }; \ - inline TypeName operator&=(TypeName& a, const TypeName& b) { \ + TypeName operator&=(TypeName& a, const TypeName& b) { \ a = TypeName{a & b}; \ return a; \ }; \ - inline TypeName operator|=(TypeName& a, const TypeName& b) { \ + TypeName operator|=(TypeName& a, const TypeName& b) { \ a = TypeName{a | b}; \ return a; \ }; \ - inline TypeName operator^=(TypeName& a, const TypeName& b) { \ + TypeName operator^=(TypeName& a, const TypeName& b) { \ a = TypeName{a ^ b}; \ return a; \ }; \ - inline TypeName operator~(TypeName& a) { \ + TypeName operator~(TypeName& a) { \ a = static_cast(~static_cast(a)); \ return a; \ }; -- cgit v1.2.3