Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2015, 10:46:11 PM (9 years ago)
Author:
landauf
Message:

using static_assert instead of BOOST_STATIC_ASSERT

Location:
code/branches/cpp11_v2/src/libraries
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.h

    r10769 r10774  
    8080#include <typeinfo>
    8181#include <loki/TypeTraits.h>
    82 #include <boost/static_assert.hpp>
    83 #include <boost/type_traits/is_base_of.hpp>
    8482
    8583#include "util/Output.h"
     
    269267    class ClassIdentifier : public Identifier
    270268    {
    271         BOOST_STATIC_ASSERT((boost::is_base_of<Identifiable, T>::value));
     269        static_assert(std::is_base_of<Identifiable, T>::value, "ClassIdentifier can only be used with Identifiables");
    272270
    273271        #ifndef DOXYGEN_SHOULD_SKIP_THIS
  • code/branches/cpp11_v2/src/libraries/core/object/IteratorBase.h

    r10770 r10774  
    3737
    3838#include "core/CorePrereqs.h"
    39 
    40 #include <boost/static_assert.hpp>
    41 #include <boost/type_traits/is_base_of.hpp>
    4239
    4340#include "ObjectListBase.h"
     
    5249    class IteratorBase : public ObjectListElementRemovalListener
    5350    {
    54         BOOST_STATIC_ASSERT((boost::is_base_of<Listable, T>::value));
     51        static_assert(std::is_base_of<Listable, T>::value, "IteratorBase can only be used with Listables");
    5552
    5653        public:
  • code/branches/cpp11_v2/src/libraries/core/object/ObjectList.h

    r10736 r10774  
    4747#include "core/CorePrereqs.h"
    4848
    49 #include <boost/static_assert.hpp>
    50 #include <boost/type_traits/is_base_of.hpp>
    51 
    5249#include "ObjectListBase.h"
    5350#include "ObjectListIterator.h"
     
    6966    class ObjectList
    7067    {
    71         BOOST_STATIC_ASSERT((boost::is_base_of<Listable, T>::value));
     68        static_assert(std::is_base_of<Listable, T>::value, "ObjectList can only be used with Listables");
    7269
    7370        public:
  • code/branches/cpp11_v2/src/libraries/network/Connection.h

    r8327 r10774  
    4646#include <map>
    4747#include <enet/enet.h>
    48 #include <boost/concept_check.hpp>
    4948
    5049namespace boost
  • code/branches/cpp11_v2/src/libraries/network/GamestateManager.h

    r10769 r10774  
    4747#include "core/CorePrereqs.h"
    4848#include "packet/Gamestate.h"
    49 #include <boost/concept_check.hpp>
    5049
    5150namespace orxonox
  • code/branches/cpp11_v2/src/libraries/network/NetworkFunctionIncludes.h

    r10624 r10774  
    3333
    3434#include <boost/preprocessor/cat.hpp>
    35 #include <boost/static_assert.hpp>
    3635
    3736#include "NetworkFunction.h"
     
    7271    inline NetworkFunctionBase* registerStaticNetworkFunctionFct(PT ptr, const std::string& name)
    7372    {
    74         BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for static functions than defined above
     73        static_assert(sizeof(PT) <= sizeof(NetworkFunctionPointer), "check pointer size"); // if this fails your compiler uses bigger pointers for static functions than defined above
    7574        NetworkFunctionPointer destptr;
    7675        copyPtr(ptr, destptr);
     
    8180    inline NetworkFunctionBase* registerMemberNetworkFunctionFct(PT ptr, const std::string& name)
    8281    {
    83         BOOST_STATIC_ASSERT(sizeof(PT) <= sizeof(NetworkFunctionPointer)); // if this fails your compiler uses bigger pointers for a specific kind of member functions than defined above
     82        static_assert(sizeof(PT) <= sizeof(NetworkFunctionPointer), "check pointer size"); // if this fails your compiler uses bigger pointers for a specific kind of member functions than defined above
    8483        NetworkFunctionPointer destptr;
    8584        copyPtr(ptr, destptr);
  • code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc

    r10768 r10774  
    3434#define WIN32_LEAN_AND_MEAN
    3535#include <enet/enet.h>
    36 #include <boost/static_assert.hpp>
    3736#include <boost/thread/mutex.hpp>
    3837
     
    5453
    5554// Make sure we assume the right values
    56 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Reliable)    == static_cast<int>(ENET_PACKET_FLAG_RELIABLE));
    57 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::Unsequenced) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED));
    58 BOOST_STATIC_ASSERT(static_cast<int>(PacketFlag::NoAllocate)  == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE));
     55static_assert(static_cast<int>(PacketFlag::Reliable)    == static_cast<int>(ENET_PACKET_FLAG_RELIABLE),    "check enum");
     56static_assert(static_cast<int>(PacketFlag::Unsequenced) == static_cast<int>(ENET_PACKET_FLAG_UNSEQUENCED), "check enum");
     57static_assert(static_cast<int>(PacketFlag::NoAllocate)  == static_cast<int>(ENET_PACKET_FLAG_NO_ALLOCATE), "check enum");
    5958
    6059#define PACKET_FLAG_DEFAULT PacketFlag::NoAllocate
Note: See TracChangeset for help on using the changeset viewer.