File tree Expand file tree Collapse file tree 4 files changed +42
-5
lines changed Expand file tree Collapse file tree 4 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 1
1
os :
2
- - Visual Studio 2015
3
- - Visual Studio 2017
2
+ - Visual Studio 2017
3
+ - Visual Studio 2015
4
+
5
+ environment :
6
+ matrix :
7
+ - STD : 17
8
+ - STD : 14
4
9
5
10
build_script :
6
11
- git submodule update --init --recursive
7
12
- mkdir build
8
13
- cd build
9
- - cmake ..
14
+ - cmake -DCMAKE_CXX_STANDARD=%STD% -DCMAKE_CXX_STANDARD_REQUIRED=True ..
10
15
- cmake --build .
11
16
- C:\projects\function-ref\build\Debug\tests.exe
17
+
18
+ matrix :
19
+ exclude :
20
+ - os : Visual Studio 2015
21
+ STD : 17
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ sudo: false
5
5
6
6
matrix :
7
7
include :
8
+ - compiler : gcc
9
+ addons :
10
+ apt :
11
+ sources :
12
+ - ubuntu-toolchain-r-test
13
+ packages :
14
+ - g++-7
15
+ env : COMPILER=g++-7 CXX_STANDARD=17
8
16
- compiler : gcc
9
17
addons :
10
18
apt :
Original file line number Diff line number Diff line change @@ -37,5 +37,8 @@ if(FUNCTION_REF_ENABLE_TESTS)
37
37
38
38
target_link_libraries (tests Catch function-ref )
39
39
40
- set_property (TARGET tests PROPERTY CXX_STANDARD 14 )
40
+ message (STATUS "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} " )
41
+ if (NOT CMAKE_CXX_STANDARD )
42
+ set_property (TARGET tests PROPERTY CXX_STANDARD 14 )
43
+ endif ()
41
44
endif ()
Original file line number Diff line number Diff line change @@ -29,4 +29,20 @@ TEST_CASE("Issue #10") {
29
29
int z = 12 ;
30
30
auto f = [&](const std::vector<int > i) { return i[0 ] * z; };
31
31
foo (f);
32
- }
32
+ }
33
+
34
+ #if __cplusplus >= 201703
35
+ struct NonCopyNonMove {
36
+ NonCopyNonMove () = default ;
37
+ NonCopyNonMove (const NonCopyNonMove &) = delete ;
38
+ NonCopyNonMove (NonCopyNonMove &&) = delete ;
39
+ };
40
+
41
+ TEST_CASE (" Issue #20" ) {
42
+ auto f = []() { return NonCopyNonMove (); };
43
+ auto fr = tl::function_ref<NonCopyNonMove ()>(f);
44
+
45
+ // silence warnings
46
+ (void )fr;
47
+ }
48
+ #endif
You can’t perform that action at this time.
0 commit comments