Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10774


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
Files:
11 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
  • code/branches/cpp11_v2/src/modules/overlays/OverlayText.cc

    r9667 r10774  
    3232#include <OgrePanelOverlayElement.h>
    3333#include <OgreTextAreaOverlayElement.h>
    34 #include <boost/static_assert.hpp>
    3534
    3635#include "util/StringUtils.h"
     
    4342    RegisterClass(OverlayText);
    4443
    45     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left);
    46     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center);
    47     BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right);
     44    static_assert((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left,   "check enum");
     45    static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center, "check enum");
     46    static_assert((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right,  "check enum");
    4847
    4948    OverlayText::OverlayText(Context* context)
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc

    r10769 r10774  
    5353#include "core/config/ConfigValueIncludes.h"
    5454#include "tools/TextureGenerator.h"
    55 // #include <boost/bind/bind_template.hpp>
    5655
    5756
  • code/branches/cpp11_v2/src/orxonox/graphics/Light.cc

    r10768 r10774  
    3131#include <OgreSceneManager.h>
    3232#include <OgreLight.h>
    33 #include <boost/static_assert.hpp>
    3433
    3534#include "util/StringUtils.h"
     
    4544
    4645    // Be sure we don't do bad conversions
    47     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT       == (int)Light::Point);
    48     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional);
    49     BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight);
     46    static_assert((int)Ogre::Light::LT_POINT       == (int)Light::Point,       "check enum");
     47    static_assert((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional, "check enum");
     48    static_assert((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight,   "check enum");
    5049
    5150    Light::Light(Context* context) : StaticEntity(context)
  • code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc

    r10768 r10774  
    3737#include <OgreSceneNode.h>
    3838#include <BulletDynamics/Dynamics/btRigidBody.h>
    39 #include <boost/static_assert.hpp>
    4039
    4140#include "util/OrxAssert.h"
     
    5756
    5857    // Be sure we don't do bad conversions
    59     BOOST_STATIC_ASSERT((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::Local);
    60     BOOST_STATIC_ASSERT((int)Ogre::Node::TS_PARENT == (int)WorldEntity::Parent);
    61     BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World);
     58    static_assert((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::Local,  "check enum");
     59    static_assert((int)Ogre::Node::TS_PARENT == (int)WorldEntity::Parent, "check enum");
     60    static_assert((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World,  "check enum");
    6261
    6362    RegisterAbstractClass(WorldEntity).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>();
Note: See TracChangeset for help on using the changeset viewer.