Commit 1ca6b90c authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'DataVector_move_assignCopy_II_test' into 'master'

Data vector move assignment noexcept Part II

See merge request !44426
parents 4655ccae bc11e09a
......@@ -2156,7 +2156,7 @@ public:
*
* Any auxiliary data will be moved along with the container contents.
*/
DataVector& operator= (DataVector&& rhs);
DataVector& operator= (DataVector&& rhs) noexcept;
/**
......
......@@ -2158,7 +2158,7 @@ DATAVECTOR& DATAVECTOR::operator= (const DataVector& rhs)
* Any auxiliary data will be moved along with the container contents.
*/
template <class T>
DATAVECTOR& DATAVECTOR::operator= (DATAVECTOR&& rhs)
DATAVECTOR& DATAVECTOR::operator= (DATAVECTOR&& rhs) noexcept
{
if (this != &rhs) {
// Ensure we're not being called via a base class.
......
......@@ -90,6 +90,7 @@ if( NOT XAOD_STANDALONE )
_add_test( DataVector_d_test )
_add_test( DataVector_e_test )
_add_test( DataVector_f_test )
_add_test( DataVector_rule5_test )
_add_test( copyAuxStoreThinned_test )
_add_test( copyThinned_test )
_add_test( dataVectorAsELV_test )
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*
* Check if DataVector of a dummy type
* is
* - default_constructible
* - copy_constructible
* - copy_assignable
* - nothrow_move_constructible
* - nothrow_move_assignable
* - is_destructible
*/
#include "AthContainers/DataVector.h"
struct apple
{
int size = 0;
int colour = 0;
};
using apples = DataVector<const apple>;
struct applePie
{
static_assert(std::is_default_constructible<apples>::value,
"DataVector fails is_default_constructible");
static_assert(std::is_copy_constructible<apples>::value,
"DataVector fails is_copy_constructible");
static_assert(std::is_copy_assignable<apples>::value,
"DataVector fails is_copy_assignable");
static_assert(std::is_nothrow_move_constructible<apples>::value,
"DataVector fails is_nothrow_move_constructible");
static_assert(std::is_nothrow_move_assignable<apples>::value,
"DataVector fails is_nothrow_move_assignable ");
static_assert(std::is_destructible<apples>::value,
"DataVector fails is_destructible");
};
int
main()
{
[[maybe_unused]] applePie myPie;
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment