This file contains hidden or 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
cmake_minimum_required(VERSION 3.9) | |
project(cppexperiments) | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_VERBOSE_MAKEFILE ON) | |
set(FORCE_CLANG ON) | |
# Force compiler to Clang++ | |
if(FORCE_CLANG) |
This file contains hidden or 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
// Author: Caio Rodrigues | |
// Descr: Sample Native Python 3 module (library) DLL | |
// | |
// Compile with: | |
// $ clang++ mymodule.cpp -o mymodule.so -g -std=c++1z -fPIC -shared -I/usr/include/python3.6m | |
//------------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <functional> |
This file contains hidden or 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
$ clang++ boost-operator.cpp -o boost-operator.bin -std=c++1z -g -O0 -Wall && ./boost-operator.bin | |
=>> v1 = Vec3D{ x = 3 ; y = 5 ; z = 6 } | |
=>> v2 = Vec3D{ x = 12 ; y = 5 ; z = 9 } | |
=>> v1.norm() = 8.3666 | |
=>> v2.norm() = 15.8114 | |
EXPERIMENT 1 boost::less_than_comparable<Vec3D> | |
-------------------------------------------------- | |
[a] v1 < v2 = true |
This file contains hidden or 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
// Compile with: | |
// $ clang++ cstr.cpp -o cstr.so -std=c++1z -O0 -g -shared -fPIC -std=c++1z | |
//---------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <cstring> // std::strncpy | |
#include <cmath> | |
#if defined(_WIN32) |
This file contains hidden or 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
# Doxyfile 1.8.14 | |
# This file describes the settings to be used by the documentation system | |
# doxygen (www.doxygen.org) for a project. | |
# | |
# All text after a double hash (##) is considered a comment and is placed in | |
# front of the TAG it is preceding. | |
# | |
# All text after a single hash (#) is considered a comment and will be ignored. | |
# The format is: |
This file contains hidden or 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 <iostream> | |
#include <string> // std::stof | |
#include <ostream> // operator (<<) and class ostream | |
#include <vector> | |
#include <iomanip> // setprecision | |
#include <optional> | |
// Class with optional field. | |
struct Location{ |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.9) | |
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) | |
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
CACHE STRING "") | |
message(" [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") | |
endif() | |
#========== Global Configurations =============# | |
#----------------------------------------------# |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.9) | |
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) | |
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
CACHE STRING "") | |
message(" [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}") | |
endif() | |
#======= Global Project Configuration =========# |
This file contains hidden or 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 <windows.h> | |
#include <objbase.h> | |
#include <activscp.h> | |
#include <atomic> | |
#include <cassert> | |
#include <cstdio> | |
class ScriptSite : public IActiveScriptSite | |
{ | |
public: |
This file contains hidden or 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 <iostream> | |
#include <string> | |
#include <iterator> | |
#include <iomanip> | |
// C++17 - Requires compiler linking flag: -lstdc++fs on CLang or GCC. | |
#include <filesystem> | |
namespace fs = std::filesystem; |