Skip to content

Commit

Permalink
[IMPORT] Assemble internal version of oss-trait-cleanup based on merg…
Browse files Browse the repository at this point in the history
…ebase with master
  • Loading branch information
abeels committed Feb 9, 2017
2 parents 4eedbe3 + 818c76a commit f3d9826
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 49 deletions.
9 changes: 5 additions & 4 deletions groups/bal/balst/balst_stacktrace.t.cpp
Expand Up @@ -15,6 +15,9 @@
#include <bslma_defaultallocatorguard.h>
#include <bslma_testallocator.h>
#include <bslma_testallocatorexception.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_isbitwisemoveable.h>

#include <bsls_assert.h>
#include <bsls_asserttest.h>
Expand Down Expand Up @@ -277,10 +280,8 @@ const Element &V0 = VALUES[0], &VA = V0, // 'V0', 'V1', ... are used in
// TYPE TRAITS
// ----------------------------------------------------------------------------

BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitBitwiseMoveable>::VALUE));
BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
BSLMF_ASSERT(bslmf::IsBitwiseMoveable<Obj>::value);
BSLMF_ASSERT(bslma::UsesBslmaAllocator<Obj>::value);

// ============================================================================
// TEST APPARATUS
Expand Down
6 changes: 4 additions & 2 deletions groups/bal/balst/balst_stacktraceresolverimpl_elf.cpp
Expand Up @@ -22,6 +22,9 @@ BSLS_IDENT_RCSID(balst_stacktraceresolverimpl_elf_cpp,"$Id$ $CSID$")
#include <bdlb_string.h>
#include <bdls_filesystemutil.h>

#include <bslma_usesbslmaallocator.h>
#include <bslmf_nestedtraitdeclaration.h>

#include <bsls_assert.h>
#include <bsls_platform.h>

Expand Down Expand Up @@ -991,8 +994,7 @@ class FrameRec {
bool d_isSymbolResolved;

public:
BSLALG_DECLARE_NESTED_TRAITS(u::FrameRec,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(u::FrameRec, bslma::UsesBslmaAllocator);

// CREATORS
FrameRec(const void *address,
Expand Down
8 changes: 4 additions & 4 deletions groups/bal/baltzo/baltzo_localdatetime.t.cpp
Expand Up @@ -11,8 +11,10 @@
#include <bslma_default.h>
#include <bslma_defaultallocatorguard.h>
#include <bslma_testallocator.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_assert.h>
#include <bslmf_isbitwisemoveable.h>

#include <bsls_assert.h>
#include <bsls_asserttest.h>
Expand Down Expand Up @@ -224,10 +226,8 @@ static bool someDiff(const Obj& a, const Obj& b)
// TYPE TRAITS
// ----------------------------------------------------------------------------

BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitBitwiseMoveable>::VALUE));
BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
BSLMF_ASSERT(bslmf::IsBitwiseMoveable<Obj>::value);
BSLMF_ASSERT(bslma::UsesBslmaAllocator<Obj>::value);

// ============================================================================
// GLOBAL CONSTANTS USED FOR TESTING
Expand Down
8 changes: 4 additions & 4 deletions groups/bal/baltzo/baltzo_localtimedescriptor.t.cpp
Expand Up @@ -10,8 +10,10 @@
#include <bslma_defaultallocatorguard.h>
#include <bslma_testallocator.h>
#include <bslma_testallocatormonitor.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_assert.h>
#include <bslmf_isbitwisemoveable.h>

#include <bsls_assert.h>
#include <bsls_asserttest.h>
Expand Down Expand Up @@ -199,10 +201,8 @@ typedef baltzo::LocalTimeDescriptor Obj;
// TYPE TRAITS
// ----------------------------------------------------------------------------

BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitBitwiseMoveable>::VALUE));
BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
BSLMF_ASSERT(bslmf::IsBitwiseMoveable<Obj>::value);
BSLMF_ASSERT(bslma::UsesBslmaAllocator<Obj>::value);

// ============================================================================
// GLOBAL TEST DATA
Expand Down
8 changes: 4 additions & 4 deletions groups/bal/baltzo/baltzo_localtimeperiod.t.cpp
Expand Up @@ -8,8 +8,10 @@
#include <bslma_default.h>
#include <bslma_defaultallocatorguard.h>
#include <bslma_testallocator.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_assert.h>
#include <bslmf_isbitwisemoveable.h>

#include <bsls_asserttest.h>

Expand Down Expand Up @@ -209,10 +211,8 @@ typedef bdlt::Datetime T3; // 'utcEndTime'
// TYPE TRAITS
// ----------------------------------------------------------------------------

BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitBitwiseMoveable>::VALUE));
BSLMF_ASSERT((bslalg::HasTrait<Obj,
bslalg::TypeTraitUsesBslmaAllocator>::VALUE));
BSLMF_ASSERT(bslmf::IsBitwiseMoveable<Obj>::value);
BSLMF_ASSERT(bslma::UsesBslmaAllocator<Obj>::value);

// ============================================================================
// GLOBAL CONSTANTS USED FOR TESTING
Expand Down
8 changes: 8 additions & 0 deletions groups/bdl/bdlat/bdlat_attributeinfo.h
Expand Up @@ -84,6 +84,14 @@ BSLS_IDENT("$Id: $")
#include <bdlat_bdeatoverrides.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYCOPYABLE
#include <bslmf_istriviallycopyable.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYDEFAULTCONSTRUCTIBLE
#include <bslmf_istriviallydefaultconstructible.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif
Expand Down
8 changes: 8 additions & 0 deletions groups/bdl/bdlat/bdlat_enumeratorinfo.h
Expand Up @@ -43,6 +43,14 @@ BSLS_IDENT("$Id: $")
#include <bdlat_bdeatoverrides.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYCOPYABLE
#include <bslmf_istriviallycopyable.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYDEFAULTCONSTRUCTIBLE
#include <bslmf_istriviallydefaultconstructible.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif
Expand Down
8 changes: 8 additions & 0 deletions groups/bdl/bdlat/bdlat_selectioninfo.h
Expand Up @@ -84,6 +84,14 @@ BSLS_IDENT("$Id: $")
#include <bdlat_bdeatoverrides.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYCOPYABLE
#include <bslmf_istriviallycopyable.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYDEFAULTCONSTRUCTIBLE
#include <bslmf_istriviallydefaultconstructible.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif
Expand Down
3 changes: 3 additions & 0 deletions groups/bdl/bdlat/bdlat_typetraits.t.cpp
Expand Up @@ -13,6 +13,9 @@
#include <bslim_testutil.h>

#include <bslalg_hastrait.h>
#include <bslalg_typetraitbitwisemoveable.h>
#include <bslalg_typetraitusesbslmaallocator.h>

#include <bsl_iostream.h>

#include <bsl_cstdlib.h>
Expand Down
28 changes: 12 additions & 16 deletions groups/bdl/bdlc/bdlc_hashtable.h
Expand Up @@ -579,10 +579,6 @@ BSLS_IDENT("$Id: $")
#include <bslma_usesbslmaallocator.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif

#ifndef INCLUDED_BSLMF_ASSERT
#include <bslmf_assert.h>
#endif
Expand All @@ -595,6 +591,14 @@ BSLS_IDENT("$Id: $")
#include <bslmf_issame.h>
#endif

#ifndef INCLUDED_BSLMF_ISTRIVIALLYDEFAULTCONSTRUCTIBLE
#include <bslmf_istriviallydefaultconstructible.h>
#endif

#ifndef INCLUDED_BSLMF_NESTEDTRAITDECLARATION
#include <bslmf_nestedtraitdeclaration.h>
#endif

#ifndef INCLUDED_BSLMF_NIL
#include <bslmf_nil.h>
#endif
Expand Down Expand Up @@ -1381,9 +1385,7 @@ inline
bool bdlc::HashTableDefaultTraits::isNull(const BUCKET& bucket)
{
enum {
k_IS_POD = bslalg::HasTrait<
BUCKET,
bslalg::TypeTraitHasTrivialDefaultConstructor>::VALUE
k_IS_POD = bsl::is_trivially_default_constructible<BUCKET>::value
};

BSLMF_ASSERT(k_IS_POD);
Expand Down Expand Up @@ -1422,9 +1424,7 @@ void bdlc::HashTableDefaultTraits::setToNull(BUCKET *bucket)
BSLS_ASSERT_SAFE(bucket);

enum {
k_IS_POD = bslalg::HasTrait<
BUCKET,
bslalg::TypeTraitHasTrivialDefaultConstructor>::VALUE
k_IS_POD = bsl::is_trivially_default_constructible<BUCKET>::value
};

BSLMF_ASSERT(k_IS_POD);
Expand Down Expand Up @@ -1466,9 +1466,7 @@ inline
bool bdlc::HashTableDefaultTraits::isRemoved(const BUCKET& bucket)
{
enum {
k_IS_POD = bslalg::HasTrait<
BUCKET,
bslalg::TypeTraitHasTrivialDefaultConstructor>::VALUE
k_IS_POD = bsl::is_trivially_default_constructible<BUCKET>::value
};

BSLMF_ASSERT(k_IS_POD);
Expand Down Expand Up @@ -1515,9 +1513,7 @@ void bdlc::HashTableDefaultTraits::setToRemoved(BUCKET *bucket)
BSLS_ASSERT_SAFE(bucket);

enum {
k_IS_POD = bslalg::HasTrait<
BUCKET,
bslalg::TypeTraitHasTrivialDefaultConstructor>::VALUE
k_IS_POD = bsl::is_trivially_default_constructible<BUCKET>::value
};

BSLMF_ASSERT(k_IS_POD);
Expand Down
4 changes: 2 additions & 2 deletions groups/bdl/bdlcc/bdlcc_objectcatalog.t.cpp
Expand Up @@ -23,6 +23,7 @@
#include <bdlt_currenttime.h>

#include <bslma_default.h>
#include <bslma_usesbslmaallocator.h>

#include <bsls_alignmentfromtype.h>
#include <bsls_alignmentutil.h>
Expand Down Expand Up @@ -845,8 +846,7 @@ class AllocPattern {

public:
// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(AllocPattern,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(AllocPattern, bslma::UsesBslmaAllocator);

static int objCount;

Expand Down
5 changes: 3 additions & 2 deletions groups/bdl/bdlcc/bdlcc_sharedobjectpool.t.cpp
Expand Up @@ -29,6 +29,7 @@
#include <bslma_default.h>
#include <bslma_defaultallocatorguard.h>
#include <bslma_testallocator.h>
#include <bslma_usesbslmaallocator.h>

#include <bsls_spinlock.h>
#include <bsls_stopwatch.h>
Expand Down Expand Up @@ -547,8 +548,8 @@ struct ConstructorTestHelp1a
{}

// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(ConstructorTestHelp1a,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(ConstructorTestHelp1a,
bslma::UsesBslmaAllocator);

// ACCESSORS
void reset();
Expand Down
7 changes: 4 additions & 3 deletions groups/btl/btlmt/btlmt_channelpoolchannel.t.cpp
Expand Up @@ -28,6 +28,9 @@
#include <bslma_defaultallocatorguard.h>
#include <bslma_allocator.h>
#include <bslma_default.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_nestedtraitdeclaration.h>

#include <bslx_marshallingutil.h>

Expand Down Expand Up @@ -522,9 +525,7 @@ class my_Server {

public:
// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(my_Server,
bslalg::TypeTraitUsesBslmaAllocator);

BSLMF_NESTED_TRAIT_DECLARATION(my_Server, bslma::UsesBslmaAllocator);
// CREATORS
my_Server(const btlmt::ChannelPoolConfiguration& config,
bslma::Allocator *basicAllocator = 0);
Expand Down
17 changes: 9 additions & 8 deletions groups/btl/btlmt/btlmt_sessionpool.t.cpp
Expand Up @@ -19,6 +19,9 @@
#include <btlso_flag.h>

#include <bslma_testallocator.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_nestedtraitdeclaration.h>

#include <bslmt_mutex.h>
#include <bslmt_threadutil.h>
Expand Down Expand Up @@ -554,8 +557,7 @@ class TestFactory : public btlmt::SessionFactory {

public:
// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(TestFactory,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(TestFactory, bslma::UsesBslmaAllocator);

// CREATORS
TestFactory(BlobReadCallback *callback = 0,
Expand Down Expand Up @@ -1107,8 +1109,7 @@ class TesterFactory : public btlmt::SessionFactory {
enum { LISTENER = 0, CONNECTOR };

// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(TesterFactory,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(TesterFactory, bslma::UsesBslmaAllocator);

// CREATORS
TesterFactory(int mode,
Expand Down Expand Up @@ -1500,8 +1501,8 @@ namespace BTLMT_SESSION_POOL_USAGE_EXAMPLE {

public:
// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(my_EchoSessionFactory,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(my_EchoSessionFactory,
bslma::UsesBslmaAllocator);

// CREATORS
my_EchoSessionFactory(bslma::Allocator *basicAllocator = 0);
Expand Down Expand Up @@ -1666,8 +1667,8 @@ namespace BTLMT_SESSION_POOL_USAGE_EXAMPLE {

public:
// TRAITS
BSLALG_DECLARE_NESTED_TRAITS(my_EchoServer,
bslalg::TypeTraitUsesBslmaAllocator);
BSLMF_NESTED_TRAIT_DECLARATION(my_EchoServer,
bslma::UsesBslmaAllocator);

// CREATORS
my_EchoServer(bslmt::Mutex *coutLock,
Expand Down

0 comments on commit f3d9826

Please sign in to comment.