Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
9080b5e
Initial (partial) implementation of #2241
AlexGuteniev Oct 10, 2021
9c9bf5d
newline
AlexGuteniev Oct 10, 2021
fac83e4
clang format
AlexGuteniev Oct 10, 2021
ae2578c
fix test pass
AlexGuteniev Oct 10, 2021
ff787b6
proper C++23 check
AlexGuteniev Oct 10, 2021
7d677b5
overalignment test
AlexGuteniev Oct 10, 2021
6dbf900
calling convention
AlexGuteniev Oct 10, 2021
bb5f066
clang format
AlexGuteniev Oct 10, 2021
d051209
calling convention
AlexGuteniev Oct 10, 2021
c650cc3
clang format
AlexGuteniev Oct 10, 2021
2e3a38d
optimize copying small function
AlexGuteniev Oct 10, 2021
dfcb9c3
abort if not callable
AlexGuteniev Oct 10, 2021
47d4af8
abort if not callable
AlexGuteniev Oct 10, 2021
4031980
missing type
AlexGuteniev Oct 10, 2021
b2abdee
mask
AlexGuteniev Oct 10, 2021
25b3396
fix test pass
AlexGuteniev Oct 10, 2021
d2f175f
uninline, optimize
AlexGuteniev Oct 11, 2021
75ef455
comments, nullptr check
AlexGuteniev Oct 11, 2021
fc69c35
null check tests
AlexGuteniev Oct 11, 2021
610a5a7
clang format
AlexGuteniev Oct 11, 2021
1bc62c8
fix null test
AlexGuteniev Oct 11, 2021
498c47f
naming
AlexGuteniev Oct 11, 2021
7abfdbb
global new delete
AlexGuteniev Oct 11, 2021
f2cac36
clang format
AlexGuteniev Oct 11, 2021
b20cb6f
large function allocation simplification
AlexGuteniev Oct 12, 2021
6d5f2ae
spam nodiscard and noexcept
AlexGuteniev Oct 12, 2021
e5a04d3
_NODISCARD
AlexGuteniev Oct 12, 2021
9d3b2d7
_STD
AlexGuteniev Oct 12, 2021
785354f
perfect forwarding
AlexGuteniev Oct 13, 2021
bf8a295
empty move still moves vtable
AlexGuteniev Oct 13, 2021
6222cad
null check
AlexGuteniev Oct 13, 2021
04cfef1
right decay semantic
AlexGuteniev Oct 13, 2021
efe8900
clang format
AlexGuteniev Oct 13, 2021
7fa8408
in-place construction
AlexGuteniev Oct 14, 2021
0373158
clang format
AlexGuteniev Oct 14, 2021
f7e4828
clang format
AlexGuteniev Oct 14, 2021
bbee00f
missing operations
AlexGuteniev Oct 14, 2021
40182b1
clang format
AlexGuteniev Oct 14, 2021
ac8b080
assignment and swap
AlexGuteniev Oct 14, 2021
c7e3b4c
self-assignment
AlexGuteniev Oct 14, 2021
bc0a931
clang warning
AlexGuteniev Oct 14, 2021
54924b8
spawn specializations
AlexGuteniev Oct 14, 2021
96a4ae9
clang format
AlexGuteniev Oct 14, 2021
3a47d12
Perf: making special cases
AlexGuteniev Oct 14, 2021
47a2d26
optimize _Function_move_memcpy
AlexGuteniev Oct 14, 2021
e37dc10
simplify by hiding _Invoke obtaining
AlexGuteniev Oct 15, 2021
c57f41f
weird operator overload protection
AlexGuteniev Oct 15, 2021
0fc8470
#endif comments, inline
AlexGuteniev Oct 15, 2021
0a151c5
fix types
AlexGuteniev Oct 15, 2021
09ad49e
deoptimizing -- not enough evidence that the optimization is useful
AlexGuteniev Oct 16, 2021
0e47c0f
fully restore virtual flow
AlexGuteniev Oct 16, 2021
7e8aa96
fully restore virtual flow
AlexGuteniev Oct 16, 2021
3f0fb7d
no, still optimiztion is useful
AlexGuteniev Oct 16, 2021
26db3d6
empty not used
AlexGuteniev Oct 16, 2021
b6dbc35
inline variables
AlexGuteniev Oct 16, 2021
bc8af9a
restore memcpy
AlexGuteniev Oct 16, 2021
d7dc206
dup comment
AlexGuteniev Oct 16, 2021
527dc15
clang format
AlexGuteniev Oct 16, 2021
81a4624
_Vt
AlexGuteniev Oct 16, 2021
754876a
embed _Impl_t
AlexGuteniev Oct 16, 2021
ccb15c9
ctypes
AlexGuteniev Oct 16, 2021
45160fb
_NODISCARD inline
AlexGuteniev Oct 16, 2021
b72dd6b
Play fair when moving
AlexGuteniev Oct 16, 2021
5639bd8
const
AlexGuteniev Oct 16, 2021
753d29b
fix move_only_function<R(Args) const>
AlexGuteniev Oct 17, 2021
1015cc1
coverage for pointers, const, noexcept
AlexGuteniev Oct 17, 2021
00d3c30
minor cleanup, self-swap test, noexcept test fix
AlexGuteniev Oct 17, 2021
69d9b66
__cpp_noexcept_function_type in test
AlexGuteniev Oct 17, 2021
3a0ec41
clang format
AlexGuteniev Oct 17, 2021
ec120ed
this->
AlexGuteniev Oct 17, 2021
4077083
missing enable_if_t arguments
AlexGuteniev Oct 17, 2021
75de985
Merge remote-tracking branch 'upstream/main' into move_only_function
AlexGuteniev Oct 21, 2021
8bf4be0
constrain assignment
AlexGuteniev Oct 22, 2021
8c09a1e
Imperfect forwarding
AlexGuteniev Oct 22, 2021
a5da1b3
minor review comments
AlexGuteniev Nov 18, 2021
28e7e84
__stdcall everywhere!
AlexGuteniev Nov 18, 2021
2210aba
...
AlexGuteniev Nov 18, 2021
dcdb395
_Remove _Remove_cvref_t
AlexGuteniev Nov 18, 2021
80a28af
Thanks @CaseyCarter and @tcanens
AlexGuteniev Nov 18, 2021
5241aa3
Your friendly CTAD is not helping you here
AlexGuteniev Nov 19, 2021
9d4f688
const west, no rvalue ref for is_invokable_r_v
AlexGuteniev Nov 19, 2021
e04ecc6
untab
AlexGuteniev Nov 19, 2021
081d876
-ws
AlexGuteniev Nov 19, 2021
46579ba
eol
AlexGuteniev Nov 19, 2021
8414c3b
noexcept invoke
AlexGuteniev Nov 19, 2021
c178c64
assign nullptr
AlexGuteniev Nov 19, 2021
76328f4
result_type
AlexGuteniev Nov 19, 2021
b8683a2
initializer list test
AlexGuteniev Nov 19, 2021
9b94425
noexcept workaround
AlexGuteniev Nov 19, 2021
da559bc
avoid truncation
AlexGuteniev Nov 19, 2021
f77ed3b
TRANSITION
AlexGuteniev Nov 19, 2021
18011eb
`&` & `&&`
AlexGuteniev Nov 19, 2021
80f9b0e
Suppress IDE warning
AlexGuteniev Nov 19, 2021
63975dd
Suppress IDE warning
AlexGuteniev Nov 19, 2021
53d260c
Comment spelling/grammar.
StephanTLavavej Nov 19, 2021
178998d
Explicit template args for _Call are now unnecessary.
StephanTLavavej Nov 19, 2021
c8efdc2
Comment `#endif // 0`.
StephanTLavavej Nov 19, 2021
b57ed10
Repair/cleanup generator.
StephanTLavavej Nov 20, 2021
69abe7e
Test is already using namespace std.
StephanTLavavej Nov 20, 2021
ad01133
Switch parameter types to avoid theoretical narrowing.
StephanTLavavej Nov 20, 2021
7b8a26e
Call test_empty() in definition order.
StephanTLavavej Nov 20, 2021
f142080
Merge branch 'main' into move_only_function
StephanTLavavej Nov 20, 2021
e4fa851
DevCom-1208330 workaround with less repetitions
AlexGuteniev Nov 20, 2021
e9ac081
Merge branch 'move_only_function' of https://github.com/AlexGuteniev/…
AlexGuteniev Nov 20, 2021
a451335
Move out the script and convert it to Python
AlexGuteniev Dec 11, 2021
925de8b
implicit conversion to pointer to function
AlexGuteniev Dec 11, 2021
c796d2d
Merge remote-tracking branch 'upstream/main' into move_only_function
AlexGuteniev Dec 11, 2021
01dfb5b
document
AlexGuteniev Dec 11, 2021
49099a7
-whitespace
AlexGuteniev Dec 11, 2021
bde333a
Fix comment typo/grammar.
StephanTLavavej Dec 14, 2021
b48185c
Add banner, remove unnecessary semicolon.
StephanTLavavej Dec 14, 2021
7a72a01
fix uninitialized guard pointer
AlexGuteniev Dec 14, 2021
8599844
Merge branch 'move_only_function' of https://github.com/AlexGuteniev/…
AlexGuteniev Dec 14, 2021
a9db0b8
also bug fix on throwing constructor
AlexGuteniev Dec 14, 2021
4fd0c31
+coverage
AlexGuteniev Dec 14, 2021
949e038
-std
AlexGuteniev Dec 14, 2021
259cf68
Minor test style changes.
StephanTLavavej Dec 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
645 changes: 644 additions & 1 deletion stl/inc/functional

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
// Other C++20 deprecation warnings

// _HAS_CXX23 directly controls:
// P0288R9 move_only_function
// P0401R6 Providing Size Feedback In The Allocator Interface
// P0448R4 <spanstream>
// P0943R6 Supporting C Atomics In C++
Expand Down Expand Up @@ -1374,9 +1375,10 @@
#define __cpp_lib_allocate_at_least 202106L
#endif // __cpp_lib_concepts

#define __cpp_lib_byteswap 202110L
#define __cpp_lib_invoke_r 202106L
#define __cpp_lib_is_scoped_enum 202011L
#define __cpp_lib_byteswap 202110L
#define __cpp_lib_invoke_r 202106L
#define __cpp_lib_is_scoped_enum 202011L
#define __cpp_lib_move_only_function 202110L

#ifdef __cpp_lib_concepts
#define __cpp_lib_out_ptr 202106L
Expand Down
1 change: 1 addition & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ tests\P0220R1_polymorphic_memory_resources
tests\P0220R1_sample
tests\P0220R1_searchers
tests\P0220R1_string_view
tests\P0288R9_move_only_function
tests\P0325R4_to_array
tests\P0339R6_polymorphic_allocator
tests\P0355R7_calendars_and_time_zones_clocks
Expand Down
25 changes: 15 additions & 10 deletions tests/std/tests/GH_000690_overaligned_function/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,28 @@ struct not_overaligned_t {

static_assert(alignof(overaligned_t) > alignof(std::max_align_t), "overaligned_t is not overaligned");

using function_t = std::function<void(const void* storage, std::size_t storage_size)>;
template <class function_t>
void test() {
struct functions_t {
function_t first{overaligned_t{}};
char smallest_pad;
function_t second{overaligned_t{}};
function_t third{overaligned_t{}};
};

struct functions_t {
function_t first{overaligned_t{}};
char smallest_pad;
function_t second{overaligned_t{}};
function_t third{overaligned_t{}};
};

int main() {
functions_t functions;
functions.first(&functions.first, sizeof(functions.first));
functions.second(&functions.second, sizeof(functions.second));
functions.third(&functions.third, sizeof(functions.third));

function_t sfo{not_overaligned_t{}};
sfo(&sfo, sizeof(sfo));
}

return 0;

int main() {
test<std::function<void(const void* storage, std::size_t storage_size)>>();
#ifdef __cpp_lib_move_only_function
test<std::move_only_function<void(const void* storage, std::size_t storage_size)>>();
#endif
}
4 changes: 4 additions & 0 deletions tests/std/tests/P0288R9_move_only_function/env.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
Loading