Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
80a37e07
Commit
80a37e07
authored
Aug 15, 2017
by
Jisi Liu
Committed by
GitHub
Aug 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3495 from pherl/c++11
Add std::forward and std::move autoconf check
parents
3d2f72bf
4a4c67b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
ax_cxx_compile_stdcxx.m4
m4/ax_cxx_compile_stdcxx.m4
+19
-0
No files found.
m4/ax_cxx_compile_stdcxx.m4
View file @
80a37e07
...
...
@@ -180,6 +180,8 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
#else
#include <utility>
namespace cxx11
{
...
...
@@ -445,6 +447,23 @@ namespace cxx11
}
namespace test_std_move_and_forward
{
struct message {};
char foo(message&) { return '\0'; }
int foo(message&&) { return 0; }
template<typename Arg, typename RT>
void check(Arg&& arg, RT rt) {
static_assert(sizeof(rt) == sizeof(foo(std::forward<Arg>(arg))), "");
}
void test() {
message a;
check(a, char());
check(std::move(a), int());
}
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment