This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: | |
:: Subroutine CompilerVersion( version ) - Return product code: 8, 10... 16, 17. | |
:: | |
:CompilerVersion version | |
@echo off & setlocal enableextensions | |
set tmpprogram=_getcompilerversion.tmp | |
set tmpsource=%tmpprogram%.c | |
:: Compiler versions, https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B | |
:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ./format-base.h | |
* | |
* In the public domain | |
* | |
* Author: Martin Moene | |
*/ | |
#ifndef FORMAT_BASE_H_INCLUDED | |
#define FORMAT_BASE_H_INCLUDED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tweak-header, A New Approach to Build-Time Library Configuration, | |
// by Colby Pike aka vector-of-bool. Oct 4, 2020 | |
// https://vector-of-bool.github.io/2020/10/04/lib-configuration.html | |
#include <cstdlib> | |
#include <string> | |
namespace program { namespace config { | |
namespace defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "nonstd/endian.hpp" | |
#include <iostream> | |
#define print_to_big_endian(x) \ | |
std::cout << #x << ": " << std::hex << to_num(x) << " to be: " << to_num(nonstd::to_big_endian(x)) << "\n" | |
#define print_to_little_endian(x) \ | |
std::cout << #x << ": " << std::hex << to_num(x) << " to le: " << to_num(nonstd::to_little_endian(x)) << "\n" | |
#define print_to_native_endian(x) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// If you write | |
// ParseError(ParseError&& other) noexcept(true) = default; | |
// the type won't be treated as nothrow move-constructable. | |
// But if you write this ctor manually - everything is ok. | |
#include <initializer_list> | |
#include <utility> | |
#include <vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++17 example of user interface with state machine based on std::variant. | |
// The state machine engine is based on code by Mateusz Pusz, | |
// https://github.com/mpusz/fsm-variant (MIT-license) | |
// CppCon 2016. Ben Deane: Using Types Effectively, | |
// https://www.youtube.com/watch?v=ojZbFIQSdl8 | |
//------------------------------------------------------------------------ | |
// State machine engine: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file1.cpp has code removed unintentionally: | |
> svn-diff-size.py --threshold -60 --histogram --revision 4710:4839 Folder/*.cpp | |
Folder/file1.cpp: (4317 -> 4136): -181 | |
Folder/file2.cpp: (2323 -> 2145): -178 | |
Folder/file2.cpp: (1031 -> 886): -145 | |
Histogram delta line-count: | |
-200: 0 | |
-180: 2 ** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file win/check_result.h | |
* | |
* \brief Windows API. | |
* \author Kenny Kerr, Martin Moene | |
* \date 3 February 2016 | |
* \since 0.0.0 | |
* | |
* From: Kenny Kerr. Windows with C++ - C++ and the Windows API. July 2011. | |
* https://msdn.microsoft.com/%20magazine/hh288076 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple C++98 functional algorithms for optional-lite | |
#include <functional> | |
#include <optional.hpp> | |
#define RESULT_OF_T(F) typename nonstd::optional_lite::detail::result_of<F>::type | |
// map(f): perform an operation `U f(T)` on optional's | |
// content if present and return an nonstd::optional<U>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off & setlocal enableextensions | |
:: | |
:: ./Catch-toclify.bat - ... (https://github.com/rasbt/markdown-toclify) | |
:: | |
if [%1] == [] goto :Usage | |
set files= %*% | |
set root=%~dp0 | |
set toclify=%root%\markdown-toclify.py |
NewerOlder