Everything (with the exception of noted functions) is written in C++11 constexpr style for maximum compatibility.
All functions are within the cx namespace.
This code is distributed under the MIT license. See LICENSE for details.
abs,fabssqrt,cbrt,hypotexp,log,log10,log2sin,cos,tanasin,acos,atan,atan2floor,ceil,trunc,round(long double variants require C++14)fmod,remainder(long double variants require C++14)fmin,fmax,fdimsinh,cosh,tanhasinh,acosh,atanhpowerf
fnv1,fnv1amurmur3_32md5sha256
strlenstrcmpendianswapcounter: returns monotonically increasing integers with each call (within a given translation unit)
cx_pcg32: a macro that returns a different randomuint32_twith each callcx_guidgen: a macro that generates a different random GUID with each call
String encryption uses std::make_index_sequence therefore requires C++14.
cx_make_encrypted_string: a macro that encrypts a string literal, with a runtime conversion to plaintextstd::string
Arrays use std::make_index_sequence therefore require C++14.
array<type, size>: a constexpr-friendly array typemake_array: create anarrayfrom e.g. a string literaltransform: likestd::transformbut works on constexprarraysreversesort: an implementation of mergesort (stable)partition: a stable partition (but usecount_ifto obtain the partition point)
accumulate: likestd::accumulatebut works on constexprarrays
Similarly:
all_of,any_of,none_ofcount,count_iffind,find_if, find_if_not`equal,mismatchfind_first_ofadjacent_findsearch,search_ninner_product