C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
exercise_3_0::cpp20 Namespace Reference

Encapsulate solution for Exercise 3-0 (C++20). More...

Functions

consteval uint32_t checked_binary (uint64_t const N)
 Prepend higher bits to lowest bit.
 

Detailed Description

Encapsulate solution for Exercise 3-0 (C++20).

Function Documentation

◆ checked_binary()

consteval uint32_t exercise_3_0::cpp20::checked_binary ( uint64_t const  N)

Prepend higher bits to lowest bit.

Parameters
[in]NA binary number to examine. Obvisouly, this should contain only 0 and 1.
Returns
A decimal representation of the given binary number.

Definition at line 28 of file c++20/exercise-3-0.hpp.