Skip to content

Instantly share code, notes, and snippets.

@DBJDBJ
DBJDBJ / dbj_meta_converter.h
Last active April 4, 2020 11:45
nicely and quickly transform any std range made of std chars into std string of your choice -- only ASCII part that is
#ifndef _DBJ_META_CONVERTER_INC_
#define _DBJ_META_CONVERTER_INC_
/*
(c) 2019/202 by dbj@dbj.org
LICENCE -- CC BY SA 4.0 -- https://creativecommons.org/licenses/by-sa/4.0/
This tool transforms any kind of char range into any required string kind.
By kind we mean "made of particular char type"
See the comprehensive testing in a separate header also here.
NOTE: be forewarned: in C++20 char8_t is actually crippled.
@kevinkreiser
kevinkreiser / logging.hpp
Last active April 17, 2024 13:25
Thread-safe logging singleton c++11
#ifndef __LOGGING_HPP__
#define __LOGGING_HPP__
/*
Test this with something like:
g++ -std=c++11 -x c++ -pthread -DLOGGING_LEVEL_ALL -DTEST_LOGGING logging.hpp -o logging_test
./logging_test
*/
#include <string>