Skip to content

Commit ac119bc

Browse files
committed
Move stored_function into its own module
1 parent ce11489 commit ac119bc

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ target_sources(containers PUBLIC
360360
source/containers/splicable.cpp
361361
source/containers/stable_vector.cpp
362362
source/containers/static_vector.cpp
363+
source/containers/stored_function.cpp
363364
source/containers/string.cpp
364365
source/containers/supports_lazy_insert_after.cpp
365366
source/containers/take.cpp

source/containers/algorithms/generate.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import containers.array;
1414
import containers.common_iterator_functions;
1515
import containers.index_type;
1616
import containers.offset_type;
17+
import containers.stored_function;
1718

1819
import bounded;
1920
import numeric_traits;
@@ -25,13 +26,6 @@ using namespace bounded::literal;
2526

2627
namespace containers {
2728

28-
template<typename Function>
29-
using stored_function = std::conditional_t<
30-
std::is_empty_v<Function> and std::is_trivially_copyable_v<Function>,
31-
std::remove_const_t<Function>,
32-
decltype(std::reference_wrapper(bounded::declval<Function &>()))
33-
>;
34-
3529
template<typename LHS, typename RHS>
3630
concept construct_subtractable = requires(LHS const lhs, RHS const rhs) {
3731
LHS(lhs - rhs);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright David Stone 2023.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
export module containers.stored_function;
7+
8+
import bounded;
9+
import std_module;
10+
11+
namespace containers {
12+
13+
export template<typename Function>
14+
using stored_function = std::conditional_t<
15+
std::is_empty_v<Function> and std::is_trivially_copyable_v<Function>,
16+
std::remove_const_t<Function>,
17+
decltype(std::reference_wrapper(bounded::declval<Function &>()))
18+
>;
19+
20+
} // namespace containers

0 commit comments

Comments
 (0)