Maipa's Standard Library Extension 1.5.6
mstd
Loading...
Searching...
No Matches
is_same_function.hpp
1/*
2 * mstd - Maipa's Standard Library
3 *
4 * Licensed under the BSD 3-Clause License with Attribution Requirement.
5 * See the LICENSE file for details: https://github.com/MAIPA01/mstd/blob/main/LICENSE
6 *
7 * Copyright (c) 2025, Patryk Antosik (MAIPA01)
8 */
9
10#pragma once
11#ifndef _MSTD_IS_SAME_FUNCTION_HPP_
12 #define _MSTD_IS_SAME_FUNCTION_HPP_
13
14 #include <mstd/config.hpp>
15
17_MSTD_WARNING("this is only available for c++17 and greater!");
18 #else
19
20 #include <mstd/functions_types.hpp>
21
22namespace mstd {
23 // Checking If functions are same
24 template<class Fa, class Fb, class = void>
25 struct is_same_function : std::false_type {};
26
27 template<class F>
28 struct is_same_function<F, F, std::void_t<std::enable_if_t<is_function_v<F> > > > : std::true_type {};
29
30 template<class Fa, class Fb>
31 struct is_same_function<Fa, Fb, std::void_t<as_std_function_t<Fa>, as_std_function_t<Fb> > >
32 : std::is_same<as_std_function_t<Fa>, as_std_function_t<Fb> > {};
33
34 template<class Fa, class Fb>
36
38 template<class Fa, class Fb> concept same_function_as = is_same_function_v<Fa, Fb>;
39 #endif
40} // namespace mstd
41 #endif
42#endif
#define _MSTD_HAS_CXX17
Definition config.hpp:45
#define _MSTD_CONSTEXPR17
Definition config.hpp:76
#define _MSTD_HAS_CXX20
Definition config.hpp:52
Definition arithmetic_types.hpp:23
_MSTD_TYPENAME17 function_traits< F >::std_function_type as_std_function_t
Definition function_traits.hpp:608
_MSTD_CONSTEXPR17 bool is_same_function_v
Definition is_same_function.hpp:35
Definition is_same_function.hpp:25