VCCC  2024.05
VisualCamp Common C++ library
implicit_expression_check.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/21.
3 //
4 
5 #ifndef VCCC_CONCEPTS_IMPLICIT_EXPRESSION_CHECK_HPP_
6 #define VCCC_CONCEPTS_IMPLICIT_EXPRESSION_CHECK_HPP_
7 
9 
10 namespace vccc {
11 namespace detail {
12 
13 template<template<typename, typename, typename...> class Check, typename Left, typename Right>
14 struct implicit_expression_check_impl
15  : conjunction<
16  Check<Left, Right&>,
17  Check<Left, Right&&>,
18  Check<Left, const Right&>,
19  Check<Left, const Right&&>
20  > {};
21 
22 } // namespace detail
23 
24 
47 template<template<typename, typename...> class Check, typename Operand, typename...>
49 
50 template<template<typename, typename, typename...> class Check, typename Left, typename Right>
51 struct implicit_expression_check<Check, Left, Right> : Check<Left, Right> {};
52 
53 template<template<typename, typename, typename...> class Check, typename Left, typename Right>
54 struct implicit_expression_check<Check, Left, const Right&>
55  : detail::implicit_expression_check_impl<Check, Left, Right> {};
56 
57 template<template<typename, typename, typename...> class Check, typename Left, typename Right>
58 struct implicit_expression_check<Check, const Left&, const Right&>
59  : conjunction<
60  detail::implicit_expression_check_impl<Check, Left&, Right>,
61  detail::implicit_expression_check_impl<Check, Left&&, Right>,
62  detail::implicit_expression_check_impl<Check, const Left&, Right>,
63  detail::implicit_expression_check_impl<Check, const Left&&, Right>
64  > {};
65 
66 template<template<typename, typename...> class Check, typename Operand>
67 struct implicit_expression_check<Check, Operand> : Check<Operand> {};
68 
69 template<template<typename, typename...> class Check, typename Operand>
70 struct implicit_expression_check<Check, const Operand&> : conjunction<
71  Check<Operand&>,
72  Check<Operand&&>,
73  Check<const Operand&>,
74  Check<const Operand&&>
75  > {};
76 
79 
80 } // namespace vccc
81 
82 #endif // VCCC_CONCEPTS_IMPLICIT_EXPRESSION_CHECK_HPP_
Definition: directory.h:12
Definition: conjunction.hpp:22
Definition: implicit_expression_check.hpp:48