- 🌏 The official ISO C++ Get Started! page
- 🎥 Herb Sutter: (Not Your Father’s) C++
- 🎥 Beginning with C++ by Jens Weller
// Copyright John McFarlane 2018. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file ../LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// mechanically retrieved, single-header version of CNL library | |
// https://github.com/johnmcfarlane/cnl | |
#if ! defined(CNL_COMPLETE_H) |
// Copyright John McFarlane 2018. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file ../LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// mechanically retrieved, single-header version of CNL library | |
// https://github.com/johnmcfarlane/cnl | |
#if ! defined(CNL_COMPLETE_H) |
// Copyright John McFarlane 2018. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file ../LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// mechanically retrieved, single-header version of CNL library | |
// https://github.com/johnmcfarlane/cnl | |
#if ! defined(CNL_COMPLETE_H) |
// code to test warning level of C++ translation unit; | |
// works with compilers which support `-Wpedantic` flag | |
// any warning level: 'extern' variable has an initializer [-Wextern-initializer] | |
// -Wall: "unused variable 'n' [-Wunused-variable]" | |
// -Wextra: "missing field 'b' initializer [-Wmissing-field-initializers]" | |
extern struct { int a, b; } n = {sizeof(void(*)(int))}; | |
// -Wpedantic: "variable length arrays are a C99 feature [-Wvla-extension]" | |
int evoke_pedantic_warning_vla(int n) { int a[n]; return a[3]; } |
There are many problems with C++ and the embedded community which mean they don't get along so well. Here are some resources that might help explain the problems and their solutions.
extern c
: Talking to C Programmers about C++” - Really great talk about embedded mindset// it's probably a good thing that CompilerExplorer's #include<https://> feature isn't recursive! |
/* | |
The MIT License (MIT) | |
Copyright (c) 2014-2019 Hana Dusíková (hanicka@hanicka.net) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
// Copyright John McFarlane 2018. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file ../LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// mechanically retrieved, single-header version of CNL library | |
// https://github.com/johnmcfarlane/cnl | |
#if ! defined(CNL_COMPLETE_H) |
#include <functional> | |
#include <type_traits> | |
#include <utility> | |
namespace cnl2 { | |
//////////////////////////////////////////////////////////////////////////////// | |
// Arithmetic - is a something that supports arithmetic operators | |
// | |
// As well as a fundamental arithmetic type (unsigned short int, __int128, etc.) | |
// a class-based type (a pack<> or a number<> instantiation) although bool is |