C++ Template Metaprogramming
Solutions to the exercises throughout the book
|
Solutions for Chapter 1. More...
Namespaces | |
namespace | cpp20 |
Solutions for Chapter 1 (C++20). | |
Classes | |
struct | binary |
Prepend higher bits to lowest bit. More... | |
struct | binary< 0 > |
Recursion termination. More... | |
Functions | |
constexpr uint32_t | binary_func (uint64_t const N) |
A runtime binary to decimal number translation. | |
consteval uint32_t | binary (uint64_t const N) |
Prepend higher bits to lowest bit. | |
unsigned | binary_func (unsigned long const N) |
A runtime binary to decimal number translation. | |
Solutions for Chapter 1.
unsigned chapter1::binary_func | ( | unsigned long const | N | ) |
A runtime binary to decimal number translation.
[in] | N | A binary number to examine. Obvisouly, this should contain only 0 and 1. |
Definition at line 35 of file chapter-1.cpp.