-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
749 additions
and
383 deletions.
There are no files selected for viewing
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,22 @@ | ||
// | ||
// Created by yonggyulee on 2024. 8. 23. | ||
// | ||
|
||
#ifndef PREVIEW_FUNCTIONAL_FOLD_H_ | ||
#define PREVIEW_FUNCTIONAL_FOLD_H_ | ||
|
||
namespace preview { | ||
|
||
template<typename F, typename Arg, typename... Args, std::enable_if_t<(sizeof...(Args) > 0)>> | ||
constexpr auto fold_left1(F&& f, Arg&& arg, Args&&... args) { | ||
return f(std::forward<Arg>(arg)) | ||
} | ||
|
||
template<typename F, typename Arg> | ||
constexpr auto fold_left1(F&& f, Arg&& arg) { | ||
return f(std::forward<Arg>(arg)); | ||
} | ||
|
||
} // namespace preview | ||
|
||
#endif // PREVIEW_INCLUDE_PREVIEW___FUNCTIONAL_FOLD_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
Oops, something went wrong.