Mountain  1.0.0
Simple C++ 2D Game Framework
concepts.hpp File Reference

Defines the Mountain::Concepts namespace which contains useful concepts used in the engine. More...

#include <format>
#include "Mountain/core.hpp"
+ Include dependency graph for concepts.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Mountain
 Contains all declarations of the Mountain Framework.
 
 Concepts
 Contains useful general-use concepts.
 

Variables

template<class T >
concept Mountain::Concepts::ResourceT = std::is_base_of_v<Resource, T>
 A class satisfies the ResourceT concept if it is derived of Resource.
 
template<class T >
concept Mountain::Concepts::LoadableResourceT = std::is_base_of_v<Resource, T> && !std::is_same_v<T, Font>
 A class satisfies the LoadableResourceT concept if it is derived of Resource and is not the Font class.
 
template<class T >
concept Mountain::Concepts::EntryT = std::is_base_of_v<Entry, T>
 A class satisfies the EntryT concept if it is derived of Entry.
 
template<class T , class U >
concept Mountain::Concepts::IsTSameAsU = std::is_same_v<T, U>
 Concept that forces a class to be same as the others.
 
template<class T >
concept Mountain::Concepts::ComponentT = std::is_base_of_v<Component, T>
 Concept that forces a type to be a child of Component.
 
template<class T >
concept Mountain::Concepts::EntityT = std::is_base_of_v<Entity, T>
 Concept that forces a type to be a child of Entity.
 
template<typename T >
concept Mountain::Concepts::FormattableT
 The Formattable concept requires a type to be formattable. More...
 
template<typename T >
concept Mountain::Concepts::ExceptionT = std::is_base_of_v<std::exception, T>
 A class satisfies the ExceptionT concept if it is derived of Exception.
 
template<class T >
concept Mountain::Concepts::FunctionT = std::is_function_v<T>
 Concept that forces a type to be a function.
 
template<typename From , typename To >
concept Mountain::Concepts::ConvertibleToT = std::convertible_to<From, To>
 
template<class T >
concept Mountain::Concepts::ColorT = std::is_same_v<Color, T> || std::is_same_v<ColorHsva, T>
 Concept that forces a type to be a color, e.g. either Color or ColorHsva.
 
template<typename T >
concept Mountain::Concepts::PointerT = std::is_pointer_v<T>
 Concept that forces a type to be a raw pointer.
 
template<typename T >
concept Mountain::Concepts::IntegralT = std::is_integral_v<T>
 Concept that forces a type to be of an integral type.
 
template<typename T >
concept Mountain::Concepts::EnumT = std::is_enum_v<T>
 
template<class T >
concept Mountain::Concepts::EffectT = std::is_base_of_v<Effect, T>
 

Detailed Description

Defines the Mountain::Concepts namespace which contains useful concepts used in the engine.

Definition in file concepts.hpp.

Variable Documentation

◆ FormattableT

template<typename T >
concept Mountain::Concepts::FormattableT
Initial value:
= requires(T& v, std::format_context ctx)
{
std::formatter<std::remove_cvref_t<T>>().format(v, ctx);
}

The Formattable concept requires a type to be formattable.

A type T is considered formattable if a template specialization of the std::formatter for T exists.

Template Parameters
TThe type to require to be formattable.

Definition at line 55 of file concepts.hpp.