3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 06:14:14 +01:00

arrays : clean move constructor of cuboid::map

- remove mess linked to old icc 13 support
and write a clear and readable code.
This commit is contained in:
Olivier Parcollet 2013-09-10 10:46:19 +02:00
parent e0f58aeb62
commit a0eba01769

View File

@ -79,20 +79,11 @@ namespace triqs { namespace arrays { namespace indexmaps { namespace cuboid {
template<ull_t Opt2, ull_t To2> map (map<Rank,Opt2,To2> const & C): template<ull_t Opt2, ull_t To2> map (map<Rank,Opt2,To2> const & C):
mydomain(C.domain()), strides_(C.strides()), start_shift_(C.start_shift()), memory_order_ (C.memory_indices_layout()) {} mydomain(C.domain()), strides_(C.strides()), start_shift_(C.start_shift()), memory_order_ (C.memory_indices_layout()) {}
// value semantics // regular type
map (map const & C) = default; map (map const & C) = default;
map (map && C) { *this = std::move(C);} map (map && C) = default;
friend void swap(map & a, map & b) {
swap(a.mydomain, b.mydomain); std::swap(a.start_shift_,b.start_shift_);
#ifdef TRIQS_WORKAROUND_INTEL_COMPILER_BUGS
std::swap(a.memory_order_.value, b.memory_order_.value);// why is there a link pb on icc ? temporary fix...
#else
std::swap(a.memory_order_, b.memory_order_);
#endif
swap(a.strides_, b.strides_);
}
map & operator = (map const & m) = default; map & operator = (map const & m) = default;
map & operator = (map && m) { swap(*this,m); return *this;} map & operator = (map && m) = default;
/// Returns the shift in position of the element key. /// Returns the shift in position of the element key.
template <typename KeyType> template <typename KeyType>