C++ Template Metaprogramming
Solutions to the exercises throughout the book
|
Solutions for Chapter 1 (C++20). 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. | |
Solutions for Chapter 1 (C++20).
consteval uint32_t chapter1::cpp20::binary | ( | uint64_t const | N | ) |
Prepend higher bits to lowest bit.
[in] | N | A binary number to examine. Obvisouly, this should contain only 0 and 1. |
Definition at line 38 of file c++20/chapter-1.cpp.
|
constexpr |
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 26 of file c++20/chapter-1.cpp.