A collection of useful C++ routines.
Go to file
Danny Robson 279af4c796 strongdef: significantly tighten restrictions on usage
It turns out that equality in particular was triggering implicit
construction of strongdef types. We make it much harder for these types
to spontaneously emerge.
2018-06-22 17:41:56 +10:00
algo build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
alloc allow/raw/linear: add typed offset query 2018-05-18 16:51:42 +10:00
cmake@1c5ded53b3 build: explicitly include the nerdcruft cmake module 2018-06-20 12:23:15 +10:00
coord coord/ops: remove misplaced include 2018-06-20 13:25:49 +10:00
debug/gdb debug: add gdb pretty printers for coord types 2018-03-28 14:55:54 +11:00
doc doc: add noise documentation stubs 2016-02-02 10:36:42 +11:00
encode build: silence various type conversion warnings 2018-01-18 11:56:42 +11:00
fixup/experimental build: don't use './' as an include prefix 2017-11-22 16:49:37 +11:00
geom geom/aabb: add query for aabb corners 2018-05-21 10:47:51 +10:00
hash hash/siphash: set default compression/finalisation params 2018-06-01 13:25:21 +10:00
job job/queue: restrict job release lambda's parameters 2018-06-18 14:01:06 +10:00
json json/tree: forward the arguments for to_json/from_json 2018-06-22 14:08:59 +10:00
json2 build: fix warnings from -Wparentheses 2018-03-27 20:16:32 +11:00
maths maths: add fast approximations WIP 2018-03-20 13:35:10 +11:00
memory scoped: eliminate the raii header 2018-06-13 15:43:01 +10:00
parallel parallel/queue: add nodiscard to push/pop 2018-03-22 14:57:34 +11:00
posix posix/except: add templated error_code 2018-04-01 14:43:28 +10:00
rand maths: remove pow2 function 2018-04-09 12:30:22 +10:00
roots use nested namespace declarations 2017-01-05 15:06:49 +11:00
test strongdef: significantly tighten restrictions on usage 2018-06-22 17:41:56 +10:00
thread build: prefer local to system include directives 2018-05-12 14:28:23 +10:00
time build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
tools json-schema: print the validated schema 2018-06-22 14:09:23 +10:00
tuple tuple/type: fix typo in remove_t 2018-06-06 19:17:41 +10:00
types types/traits: add the identity type function 2018-06-22 17:41:36 +10:00
win32 except: move posix/win32 exceptions to own units 2017-12-19 18:18:10 +11:00
.gitignore gitignore: add pretty printer python cache 2018-03-29 14:16:55 +11:00
.gitlab-ci.yml gitlab: use the correct relative address for cmake builds 2018-06-20 13:23:14 +10:00
.gitmodules build: explicitly include the nerdcruft cmake module 2018-06-20 12:23:15 +10:00
abnf.rl uri: extract grammar into contained ragel file 2017-12-20 12:45:05 +11:00
adapter.cpp unify licences 2016-02-26 13:36:01 +11:00
adapter.hpp adapter: add make_reverse for reverse adapter 2017-08-21 16:51:03 +10:00
annotation.hpp annotation: add likely/unlikely functions 2016-08-02 18:49:42 +10:00
ascii.hpp ascii: add UDL for vector and array conversions 2018-01-23 18:51:37 +11:00
backtrace_execinfo.cpp cast: move casting functions into util::cast namespace 2018-01-16 15:11:15 +11:00
backtrace_null.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
backtrace_stackwalk.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
backtrace_win32.cpp except: move posix/win32 exceptions to own units 2017-12-18 15:46:52 +11:00
backtrace.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
bezier1.cpp maths: rename limit to clamp 2018-05-03 21:43:48 +10:00
bezier2.cpp build: silence various type conversion warnings 2018-01-18 11:56:42 +11:00
bezier3.cpp maths: remove pow2 function 2018-04-09 12:30:22 +10:00
bezier.cpp build: don't use './' as an include prefix 2017-11-22 16:49:37 +11:00
bezier.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
bitwise.cpp bitwise: use bit reversal from bit twiddling hacks 2017-02-13 17:14:30 +11:00
bitwise.hpp build: fix warnings from -Wparentheses 2018-03-27 20:16:32 +11:00
cast.hpp cast: test the correct type for alignment 2018-05-10 14:54:03 +10:00
CMakeLists.txt build: add C to the required language list 2018-06-20 12:50:27 +10:00
cmdopt.cpp cast: move casting functions into util::cast namespace 2018-01-16 15:11:15 +11:00
cmdopt.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
colour.cpp Merge remote-tracking branch 'origin/master' 2018-01-10 17:19:39 +11:00
colour.hpp colour: style 2018-03-06 18:13:39 +11:00
coord.hpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
COPYING unify licences 2016-02-26 13:36:01 +11:00
cpp.cpp cpp: add basic C preprocessor emulator 2018-04-01 14:49:10 +10:00
cpp.hpp cpp: add some explanatory comments 2018-05-07 13:28:31 +10:00
cpuid_x86.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
cpuid_x86.hpp cpuid: add initial trivial CPUID queries 2018-03-18 17:29:44 +11:00
cpuid.cpp cpuid: add initial trivial CPUID queries 2018-03-18 17:29:44 +11:00
cpuid.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
debug_posix.cpp debug: enable debugging features by default 2018-03-27 15:50:29 +11:00
debug_win32.cpp except: move posix/win32 exceptions to own units 2017-12-18 15:46:52 +11:00
debug.cpp debug: add is_valid for floats 2018-04-19 20:32:30 +10:00
debug.hpp debug: add breakpoints on CHECK failures again 2018-05-10 14:53:43 +10:00
Doxyfile.in doc: improve naive doxygen support 2016-02-26 17:04:54 +11:00
endian.cpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
endian.hpp endian: refactor endian conversion 2018-05-19 18:06:34 +10:00
exe_freebsd.cpp exe: split into platform units 2016-10-10 16:23:07 +11:00
exe_linux.cpp cast: move casting functions into util::cast namespace 2018-01-16 15:11:15 +11:00
exe_win32.cpp except: move posix/win32 exceptions to own units 2017-12-18 15:46:52 +11:00
exe.hpp build: use experimental::fs over boost::fs 2016-10-07 19:48:42 +11:00
extent.cpp extent/region: simplify iteration over ranges 2018-03-23 16:38:54 +11:00
extent.hpp extent: add uniform sampler 2018-05-30 14:34:48 +10:00
fixed.cpp build: fix warnings from -Wparentheses 2018-03-27 20:16:32 +11:00
fixed.hpp build: fix warnings from -Wparentheses 2018-03-27 20:16:32 +11:00
float.cpp build: remove unnecessary includes 2016-10-12 15:08:22 +11:00
float.hpp build: remove unnecessary includes 2016-10-12 15:08:22 +11:00
format.cpp.rl build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
format.hpp view: improve template deduction guides 2018-05-10 12:48:20 +10:00
fourcc.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
fourcc.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
functor.hpp functor: add constant functor 2018-04-27 16:32:58 +10:00
gcc.hpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
hash.hpp hash: use a consistency, less flexible, interface 2018-01-13 15:24:12 +11:00
introspection.cpp build: remove explicit constexpr instantiations 2017-06-08 15:49:25 +10:00
introspection.hpp Merge branch 'master' into coord 2017-11-23 17:24:11 +11:00
io_posix.cpp build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
io_posix.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
io_win32.cpp except: move posix/win32 exceptions to own units 2017-12-18 15:46:52 +11:00
io_win32.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
io.cpp io: add slurp for uint32_t 2018-05-03 21:21:45 +10:00
io.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
iterator.hpp iterator: add make_infix overload for arrays 2018-05-14 14:36:15 +10:00
kmeans.hpp kmeans: use norm as default metric 2018-04-24 11:53:58 +10:00
libcruft-util-inline.pc.in pkg-config: remove erroneous boost build flags 2016-10-11 20:51:19 +11:00
libcruft-util-system.pc.in pkg-config: remove erroneous boost build flags 2016-10-11 20:51:19 +11:00
library_posix.cpp library: force typing for symbol queries 2018-05-03 21:22:41 +10:00
library_posix.hpp library: force typing for symbol queries 2018-05-03 21:22:41 +10:00
library_win32.cpp except: move posix/win32 exceptions to own units 2017-12-18 15:46:52 +11:00
library_win32.hpp build: use explicit constructors 2017-05-23 12:50:51 +10:00
library.hpp library: initial wrapper 2015-08-10 15:51:44 +10:00
LICENCE relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
log.cpp cast: move casting functions into util::cast namespace 2018-01-16 15:11:15 +11:00
log.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
maths.cpp maths: rename limit to clamp 2018-05-03 21:43:48 +10:00
maths.hpp maths: relax argument restrictions for min/max 2018-05-30 16:54:04 +10:00
matrix2.cpp coord: make template parameters more flexible 2017-11-22 17:03:00 +11:00
matrix3.cpp coord: make template parameters more flexible 2017-11-22 17:03:00 +11:00
matrix4.cpp coord: make template parameters more flexible 2017-11-22 17:03:00 +11:00
matrix.cpp point/vector: homog no longer takes a size parameter 2018-04-17 14:26:23 +10:00
matrix.hpp point/vector: homog no longer takes a size parameter 2018-04-17 14:26:23 +10:00
nocopy.hpp dont overinclude iostream headers 2016-03-17 18:14:40 +11:00
parse.cpp parse: instantiate unsigned in parsing 2018-03-27 16:11:04 +11:00
parse.hpp parse: use views over explit begin/end pairs 2017-12-18 14:50:10 +11:00
pascal.cpp pascal: instantiations for signed lengths 2017-05-29 17:20:43 +10:00
pascal.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
platform.hpp platform: add freebsd platform defines 2016-05-13 15:23:22 +10:00
point.cpp point: avoid signedness warnings for furthest point 2018-04-23 15:40:51 +10:00
point.hpp point: add convenience centroid function 2018-04-26 16:30:16 +10:00
pointer.hpp pointer: add align overload for pointer-views 2018-03-02 12:15:43 +11:00
polynomial.cpp maths: remove pow2 function 2018-04-09 12:30:22 +10:00
polynomial.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
pool.cpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
pool.hpp pool: launder the allocated pointers 2018-03-22 13:10:18 +11:00
preprocessor.py preprocessor: use a script to create map/reduce 2017-09-12 14:17:30 +10:00
quaternion.cpp coord/ops: add std::{cos,sin} overloads for coords 2018-03-13 14:39:38 +11:00
quaternion.hpp quaternion: add convenience quaternion-vector multiply 2018-05-08 15:51:39 +10:00
random.cpp random: remove typed randomisers without generators 2016-11-17 18:38:08 +11:00
random.hpp random: add coord generator 2018-05-30 14:33:31 +10:00
range.cpp build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
range.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
rational.cpp rational: add ostream operator 2018-04-16 16:00:32 +10:00
rational.hpp rational: add ostream operator 2018-04-16 16:00:32 +10:00
README.adoc README: consolidate README files 2018-06-05 09:35:33 +10:00
region.cpp maths: rename limit to clamp 2018-05-03 21:43:48 +10:00
region.hpp region: add union operator for region/region 2018-06-14 15:07:25 +10:00
rfc3986.rl rfc3986: don't enforce actions for rules 2017-12-26 17:34:08 +11:00
sarray.cpp build: don't use './' as an include prefix 2017-11-22 16:49:37 +11:00
sarray.hpp build: don't use './' as an include prefix 2017-11-22 16:49:37 +11:00
scoped.hpp scoped: simplify universal references 2018-06-18 13:51:59 +10:00
si.cpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
si.hpp whitespace 2015-04-13 18:06:08 +10:00
signal.cpp relicence under Apache-2.0 2015-04-13 18:05:28 +10:00
signal.hpp build: migrate from ipp files to pure hpp files 2018-02-28 11:49:13 +11:00
singleton.hpp singleton: add comments 2018-03-27 16:15:54 +11:00
stats.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
stats.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
std.hpp std: add compact fixed width typedefs 2018-06-03 15:25:17 +10:00
stream.cpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
stream.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
string.cpp string: move tokeniser into the header 2018-01-30 12:53:43 +11:00
string.hpp string: prefer type deduction over explicit typenames 2018-05-08 21:50:43 +10:00
stringid.cpp stringid: remove explicit synchronisation 2016-11-17 18:38:08 +11:00
stringid.hpp hash: use a consistency, less flexible, interface 2018-01-13 15:24:12 +11:00
strongdef.cpp build: don't use './' as an include prefix 2017-11-22 16:49:37 +11:00
strongdef.hpp strongdef: significantly tighten restrictions on usage 2018-06-22 17:41:56 +10:00
tap.cpp tap: send output to the recorded stream, not cout 2018-03-22 16:11:13 +11:00
tap.hpp tap: add proof-of-concept printf chaining 2018-04-16 16:00:32 +10:00
term.cpp string: move tokeniser into the header 2018-01-30 12:53:43 +11:00
term.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
time_posix.cpp cast: move casting functions into util::cast namespace 2018-01-16 15:11:15 +11:00
time_win32.cpp time: use std::chrono for nanoseconds query 2016-04-05 11:02:54 +10:00
time.cpp time/delta_time: return nanoseconds objects rather than floats 2018-04-05 18:48:23 +10:00
time.hpp time/delta_time: return nanoseconds objects rather than floats 2018-04-05 18:48:23 +10:00
typeidx.cpp typeidx: use atomic variables for thread safety 2018-04-05 12:14:11 +10:00
typeidx.hpp typeidx: use atomic variables for thread safety 2018-04-05 12:14:11 +10:00
types.hpp tuple/variadic: split into type/value/pack operations 2018-03-15 23:48:21 +11:00
uri.cpp.rl build: update for gcc-8.1 warnings 2018-05-03 18:32:08 +10:00
uri.hpp hash: use a consistency, less flexible, interface 2018-01-13 15:24:12 +11:00
utf8.cpp utf8: clearer comments 2017-10-03 17:48:27 +11:00
utf8.hpp utf8: use an iterator style interface internally 2017-10-02 16:15:19 +11:00
variadic.cpp variadic: add index helper type 2015-04-20 17:13:14 +10:00
variadic.hpp variadic: add filter call 2018-03-23 16:40:30 +11:00
vector.cpp vector: add validator specialisation 2018-04-16 16:00:32 +10:00
vector.hpp vector: add hughes-moeller make_basis 2018-04-18 21:48:55 +10:00
version.cpp.rl debug: don't rely on format for output 2018-05-10 12:44:03 +10:00
version.hpp build: prefer iosfwd over iostream 2018-03-22 16:11:13 +11:00
view.cpp view: move ostream operator into header 2017-12-26 17:34:08 +11:00
view.hpp view: remove unnecessary enable_if type 2018-05-10 13:31:51 +10:00
zlib.cpp unify licences 2016-02-26 13:36:01 +11:00
zlib.hpp build: make single argument constructors explicit 2015-06-04 22:18:43 +10:00

== libcruft-util

A simple cross-platform C++ utility library.

Supported compilers: >=clang-5.x, >=gcc7.x; specifically, we require cxx17 features such as structured bindings which aren't present in older compilers. No attempt has been made to compile under MSVC.

=== Environment Variables

The following variables can be defined at runtime to change the library behaviour.

DEBUG:: whether to initialise basic debugging features at load time. the value is irrelevant; the test is for whether the variable is defined.
DEBUG_WAIT:: whether to wait for a debugger to attach before executing `main`.

LOG_LEVEL:: minimum log level that will render to the logging stream. note that a given level may have been compiled out and may not be present, eg. DEBUG tends to only be present for debug builds.
BREAK_LEVEL:: minimum log level that will trigger a breakpoint

JOB_THREADS:: default number of threads to spin up for job queues.
JOB_DEPTH:: the default size of the pending work item queue for a job queue.

Ideally one would not resort to using these variables, but they may make debugging a little easier in some circumstances.