Challenge: A Custom Concept Using Concepts from the C++ STL

Try to implement a concept by using existing concepts from the standard library.

We'll cover the following

Problem

Write a concept using concepts from the standard library that accepts types that fulfill the following criteria:

  • They are copyable.
  • They are movable.
  • They can be constructed with an integer and a floating point number.
  • They are the child classes of a certain type.

Try it yourself first. If you have trouble getting to the solution, you can always press the “Show Solution” to see how the problem can be solved… We’ll go through the in-depth solution in the next lesson.

Good luck!

Get hands-on with 1200+ tech skills courses.