0% found this document useful (0 votes)
8 views3 pages

Constexpr If Examples Exercises

The document provides exercises focused on using 'constexpr if' in C++ programming. It includes tasks such as generating Fibonacci numbers through template specialization and 'constexpr if', as well as rewriting examples from a previous lecture on variadic templates. The aim is to compare different solutions and enhance understanding of these concepts.

Uploaded by

Gnomic Bits
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Constexpr If Examples Exercises

The document provides exercises focused on using 'constexpr if' in C++ programming. It includes tasks such as generating Fibonacci numbers through template specialization and 'constexpr if', as well as rewriting examples from a previous lecture on variadic templates. The aim is to compare different solutions and enhance understanding of these concepts.

Uploaded by

Gnomic Bits
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Constexpr If Examples

Exercises

Copyright © James Raynard 2022


Fibonacci Number
• Write a program which generates a Fibonacci number using
• Template specialization
• Constexpr if
• Compare your solutions

Copyright © James Raynard 2022


Parameter Pack with Constexpr If
• Rewrite the example from the Variadic Templates lecture to use
constexpr if

Copyright © James Raynard 2022

You might also like