C++ Library Extensions 2022.12.09
To help learn modern C++ programming
042-compile_time_expression.cpp File Reference
#include <tpf_output.hpp>
Include dependency graph for 042-compile_time_expression.cpp:

Go to the source code of this file.

Functions

void test_const_expression ()
 
constexpr size_t get_size ()
 
void why_constant_expression_is_misnomer ()
 
template<int * ptr>
int get_a_value ()
 
void test_non_type_template_parameters ()
 
template<auto ptr>
auto get_a_value_using_auto ()
 
void test_get_a_value_auto ()
 
void test_failure_case ()
 
void important_concept_for_compile_time_expression ()
 
void why_it_fails ()
 
int main ()
 

Variables

tpf::sstream stream
 
auto endl = tpf::endl
 
int gGlobalInt = 10
 

Function Documentation

◆ get_a_value()

template<int * ptr>
int get_a_value ( )

Definition at line 67 of file 042-compile_time_expression.cpp.

◆ get_a_value_using_auto()

template<auto ptr>
auto get_a_value_using_auto ( )

Definition at line 80 of file 042-compile_time_expression.cpp.

◆ get_size()

constexpr size_t get_size ( )
constexpr

Definition at line 18 of file 042-compile_time_expression.cpp.

Here is the caller graph for this function:

◆ important_concept_for_compile_time_expression()

void important_concept_for_compile_time_expression ( )

Definition at line 111 of file 042-compile_time_expression.cpp.

◆ main()

int main ( )

Definition at line 162 of file 042-compile_time_expression.cpp.

Here is the call graph for this function:

◆ test_const_expression()

void test_const_expression ( )

Definition at line 7 of file 042-compile_time_expression.cpp.

◆ test_failure_case()

void test_failure_case ( )

Definition at line 97 of file 042-compile_time_expression.cpp.

◆ test_get_a_value_auto()

void test_get_a_value_auto ( )

Definition at line 85 of file 042-compile_time_expression.cpp.

◆ test_non_type_template_parameters()

void test_non_type_template_parameters ( )

Definition at line 72 of file 042-compile_time_expression.cpp.

◆ why_constant_expression_is_misnomer()

void why_constant_expression_is_misnomer ( )

Definition at line 23 of file 042-compile_time_expression.cpp.

Here is the call graph for this function:

◆ why_it_fails()

void why_it_fails ( )

Definition at line 134 of file 042-compile_time_expression.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ endl

auto endl = tpf::endl

Definition at line 4 of file 042-compile_time_expression.cpp.

◆ gGlobalInt

int gGlobalInt = 10

Definition at line 64 of file 042-compile_time_expression.cpp.

◆ stream

tpf::sstream stream

Definition at line 3 of file 042-compile_time_expression.cpp.