Skip to content

Commit

Permalink
Replacing alignof with std::alignment_of
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Heller committed Jul 26, 2016
1 parent 249886a commit 5b37945
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions hpx/lcos/detail/future_data.hpp
Expand Up @@ -151,8 +151,10 @@ namespace detail
// determine the required alignment, define aligned storage of proper
// size
HPX_STATIC_CONSTEXPR std::size_t max_alignment =
(alignof(value_type) > alignof(error_type)) ?
alignof(value_type) : alignof(error_type);
(std::alignment_of<value_type>::value >
std::alignment_of<error_type>::value) ?
std::alignment_of<value_type>::value
: std::alignment_of<error_type>::value;

HPX_STATIC_CONSTEXPR std::size_t max_size =
(sizeof(value_type) > sizeof(error_type)) ?
Expand Down
2 changes: 1 addition & 1 deletion hpx/lcos/local/reinitializable_static.hpp
Expand Up @@ -134,7 +134,7 @@ namespace hpx { namespace lcos { namespace local
}

typedef typename std::aligned_storage<sizeof(value_type),
alignof(value_type)>::type storage_type;
std::alignment_of<value_type>::value>::type storage_type;

static storage_type data_[N];
static lcos::local::once_flag constructed_;
Expand Down
2 changes: 1 addition & 1 deletion hpx/util/reinitializable_static.hpp
Expand Up @@ -141,7 +141,7 @@ namespace hpx { namespace util
}

typedef typename std::aligned_storage<sizeof(value_type),
alignof(value_type)>::type storage_type;
std::alignment_of<value_type>::value>::type storage_type;

static storage_type data_[N];
static boost::once_flag constructed_;
Expand Down
2 changes: 1 addition & 1 deletion hpx/util/static.hpp
Expand Up @@ -157,7 +157,7 @@ namespace hpx { namespace util
}

typedef typename std::aligned_storage<sizeof(value_type),
alignof(value_type)>::type storage_type;
std::alignment_of<value_type>::value>::type storage_type;

static storage_type data_;
static boost::once_flag constructed_;
Expand Down

0 comments on commit 5b37945

Please sign in to comment.