CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Function.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
13#include <function2/function2.hpp>
14
15namespace CeresEngine {
16
48 template<bool IsOwning, bool IsCopyable, typename Capacity, bool IsThrowing, bool HasStrongExceptGuarantee, typename... Signatures>
50
52 template<typename... Signatures>
53 using Function = FunctionBase<true, true, fu2::capacity_default, //
54 true, false, Signatures...>;
55
57 template<typename... Signatures>
58 using UniqueFunction = FunctionBase<true, false, fu2::capacity_default, //
59 true, false, Signatures...>;
60
62 template<typename... Signatures>
63 using FunctionView = FunctionBase<false, true, fu2::capacity_default, //
64 true, false, Signatures...>;
65
71 using BadFunctionCall = fu2::bad_function_call;
72
85 template<typename... T> constexpr auto overload(T&&... callables) { return fu2::overload(std::forward<T>(callables)...); }
86
87} // namespace CeresEngine
Definition Application.hpp:19
fu2::bad_function_call BadFunctionCall
Exception type that is thrown when invoking empty function objects and exception support isn't disabl...
Definition Function.hpp:71
constexpr auto overload(T &&... callables)
Returns a callable object, which unifies all callable objects that were passed to this function.
Definition Function.hpp:85
FunctionBase< true, true, fu2::capacity_default, true, false, Signatures... > Function
An owning copyable function wrapper for arbitrary callable types.
Definition Function.hpp:54
FunctionBase< false, true, fu2::capacity_default, true, false, Signatures... > FunctionView
A non owning copyable function wrapper for arbitrary callable types.
Definition Function.hpp:64
fu2::function_base< IsOwning, IsCopyable, Capacity, IsThrowing, HasStrongExceptGuarantee, Signatures... > FunctionBase
An adaptable function wrapper base for arbitrary functional types.
Definition Function.hpp:49
FunctionBase< true, false, fu2::capacity_default, true, false, Signatures... > UniqueFunction
An owning non copyable function wrapper for arbitrary callable types.
Definition Function.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25