-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix requires expression evaluating implicit expression check (#14)
- Loading branch information
Showing
11 changed files
with
99 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// Created by yonggyulee on 2023/12/21. | ||
// | ||
|
||
#ifndef PREVIEW_CONCEPTS_REQUIRES_EXPRESSION_H_ | ||
#define PREVIEW_CONCEPTS_REQUIRES_EXPRESSION_H_ | ||
|
||
#include "preview/__type_traits/conjunction.h" | ||
|
||
namespace preview { | ||
namespace detail { | ||
|
||
template<template<typename, typename, typename...> class Check, typename Left, typename Right> | ||
struct implicit_expression_check | ||
: conjunction< | ||
Check<Left, Right&>, | ||
Check<Left, Right&&>, | ||
Check<Left, const Right&>, | ||
Check<Left, const Right&&> | ||
> {}; | ||
|
||
} // namespace detail | ||
|
||
template<template<typename, typename...> class Check, typename Operand, typename...> | ||
struct requires_expression; | ||
|
||
template<template<typename, typename...> class Check, typename Operand> | ||
struct requires_expression<Check, Operand> : Check<Operand> {}; | ||
|
||
template<template<typename, typename, typename...> class Check, typename Left, typename Right> | ||
struct requires_expression<Check, Left, Right> : Check<Left, Right> {}; | ||
|
||
// TODO: Add diagnostics for implicit requires expansion | ||
// | ||
//template<template<typename, typename, typename...> class Check, typename Left, typename Right> | ||
//struct requires_expression<Check, Left, const Right&> | ||
// : detail::implicit_expression_check<Check, Left, Right> {}; | ||
//s | ||
//template<template<typename, typename, typename...> class Check, typename Left, typename Right> | ||
//struct requires_expression<Check, const Left&, const Right&> | ||
// : conjunction< | ||
// detail::implicit_expression_check<Check, Left&, Right>, | ||
// detail::implicit_expression_check<Check, Left&&, Right>, | ||
// detail::implicit_expression_check<Check, const Left&, Right>, | ||
// detail::implicit_expression_check<Check, const Left&&, Right> | ||
// > {}; | ||
|
||
//template<template<typename, typename...> class Check, typename Operand> | ||
//struct requires_expression<Check, const Operand&> : conjunction< | ||
// Check<Operand&>, | ||
// Check<Operand&&>, | ||
// Check<const Operand&>, | ||
// Check<const Operand&&> | ||
// > {}; | ||
|
||
} // namespace preview | ||
|
||
#endif // PREVIEW_CONCEPTS_REQUIRES_EXPRESSION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters