-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename from CamelScase to snake_case
- Loading branch information
1 parent
3268d37
commit 9d24836
Showing
17 changed files
with
228 additions
and
75 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <Beman/Example/identity.hpp> | ||
#include <beman/example/identity.hpp> | ||
|
||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << Beman::Example::identity()(2024) << '\n'; | ||
std::cout << beman::example::identity()(2024) << '\n'; | ||
return 0; | ||
} |
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,48 @@ | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#ifndef BEMAN_EXAMPLE_IDENTITY_HPP | ||
#define BEMAN_EXAMPLE_IDENTITY_HPP | ||
|
||
// C++ Standard Library: std::identity equivalent. | ||
// See https://eel.is/c++draft/func.identity: | ||
// | ||
// 22.10.12 Class identity [func.identity] | ||
// | ||
// struct identity { | ||
// template<class T> | ||
// constexpr T&& operator()(T&& t) const noexcept; | ||
// | ||
// using is_transparent = unspecified; | ||
// }; | ||
// | ||
// template<class T> | ||
// constexpr T&& operator()(T&& t) const noexcept; | ||
// | ||
// Effects: Equivalent to: return std::forward<T>(t); | ||
|
||
#include <utility> // std::forward | ||
|
||
namespace beman::example { | ||
|
||
struct __is_transparent; // not defined | ||
|
||
// A function object that returns its argument unchanged. | ||
struct identity | ||
{ | ||
// Returns `t`. | ||
template <class T> | ||
#if defined(__cpp_constexpr) | ||
constexpr | ||
#endif | ||
T && | ||
operator()(T &&t) const noexcept | ||
{ | ||
return std::forward<T>(t); | ||
} | ||
|
||
using is_transparent = __is_transparent; | ||
}; | ||
|
||
} // namespace beman::example | ||
|
||
#endif // BEMAN_EXAMPLE_IDENTITY_HPP |
Oops, something went wrong.