Skip to content

Commit

Permalink
Merge pull request #2677 from STEllAR-GROUP/inspect_addressof
Browse files Browse the repository at this point in the history
Adding include check for std::addressof
  • Loading branch information
hkaiser committed Jun 4, 2017
2 parents 2cb968d + 2c85183 commit 48b891c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion hpx/parallel/algorithms/uninitialized_copy.hpp
Expand Up @@ -22,6 +22,7 @@
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -71,7 +72,8 @@ namespace hpx { namespace parallel { inline namespace v1
util::loop_with_cleanup_n_with_token(
first, count, dest, tok,
[](Iter it, FwdIter dest) {
::new (&*dest) value_type(*it);
::new (static_cast<void*>(std::addressof(*dest)))
value_type(*it);
},
[](FwdIter dest) {
(*dest).~value_type();
Expand Down
4 changes: 3 additions & 1 deletion hpx/parallel/algorithms/uninitialized_fill.hpp
Expand Up @@ -22,6 +22,7 @@
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -69,7 +70,8 @@ namespace hpx { namespace parallel { inline namespace v1
util::loop_with_cleanup_n_with_token(
first, count, tok,
[&value](FwdIter it) {
::new (&*it) value_type(value);
::new (static_cast<void*>(std::addressof(*it)))
value_type(value);
},
[](FwdIter it) {
(*it).~value_type();
Expand Down
1 change: 1 addition & 0 deletions tools/inspect/include_check.cpp
Expand Up @@ -31,6 +31,7 @@ namespace boost
{ "(\\bstd\\s*::\\s*((map)|(set))\\b)", "std::\\2", "\\2" },
{ "(\\bstd\\s*::\\s*(multi((map)|(set)))\\b)", "std::\\2", "\\3" },
{ "(\\bstd\\s*::\\s*((shared|unique)_ptr)\\b)", "std::\\2", "memory" },
{ "(\\bstd\\s*::\\s*addressof\\b)", "std::addressof", "memory" },
{ "(\\bstd\\s*::\\s*(unordered_((map|set)))\\b)", "std::\\2", "unordered_\\3" },
{ "(\\bstd\\s*::\\s*(unordered_multi((map)|(set)))\\b)", "std::\\2", "unordered_\\3" },
{ "(\\bstd\\s*::\\s*list\\b)", "std::list", "list" },
Expand Down

0 comments on commit 48b891c

Please sign in to comment.