Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2015, 5:36:14 PM (9 years ago)
Author:
landauf
Message:

using some constexpr

Location:
code/branches/cpp11_v2/src/libraries/core
Files:
4 edited

Legend:

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

    r10624 r10994  
    6868namespace orxonox
    6969{
    70     static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
     70    static constexpr uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
    7171}
    7272
     
    8282
    8383        //!A list of available scopes for the Scope template.
    84         static const Value ROOT = 1;
    85         static const Value GRAPHICS = 2;
     84        static constexpr Value ROOT = 1;
     85        static constexpr Value GRAPHICS = 2;
    8686    }
    8787
     
    9090        typedef int Type;
    9191
    92         static const Type STATIC_INITIALIZATION_HANDLER = 1;
    93         static const Type IDENTIFIER = 2;
    94         static const Type SCOPED_SINGLETON_WRAPPER = 3;
    95         static const Type COMMAND_LINE_ARGUMENT = 4;
    96         static const Type CONSOLE_COMMAND = 5;
     92        static constexpr Type STATIC_INITIALIZATION_HANDLER = 1;
     93        static constexpr Type IDENTIFIER = 2;
     94        static constexpr Type SCOPED_SINGLETON_WRAPPER = 3;
     95        static constexpr Type COMMAND_LINE_ARGUMENT = 4;
     96        static constexpr Type CONSOLE_COMMAND = 5;
    9797    }
    9898
  • code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.h

    r10992 r10994  
    118118            static CommandEvaluation evaluate(const std::string& command);
    119119
    120             static const int Success = 0;       ///< Error code for "success" (or no error)
    121             static const int Inexistent = 1;    ///< Error code if the command doesn't exist
    122             static const int Incomplete = 2;    ///< Error code if the command needs more arguments
    123             static const int Deactivated = 3;   ///< Error code if the command is not active
    124             static const int Denied = 4;        ///< Error code if the command needs a different access level
    125             static const int Error = 5;         ///< Error code if the command returned an error
     120            static constexpr int Success = 0;       ///< Error code for "success" (or no error)
     121            static constexpr int Inexistent = 1;    ///< Error code if the command doesn't exist
     122            static constexpr int Incomplete = 2;    ///< Error code if the command needs more arguments
     123            static constexpr int Deactivated = 3;   ///< Error code if the command is not active
     124            static constexpr int Denied = 4;        ///< Error code if the command needs a different access level
     125            static constexpr int Error = 5;         ///< Error code if the command returned an error
    126126
    127127            static std::string getErrorDescription(int error);
  • code/branches/cpp11_v2/src/libraries/core/command/IRC.cc

    r10768 r10994  
    4444namespace orxonox
    4545{
    46     static const unsigned int IRC_TCL_THREADID  = 1421421421;   ///< The ID of the thread in TclThreadManager that is used for the IRC connection
     46    static constexpr unsigned int IRC_TCL_THREADID  = 1421421421;   ///< The ID of the thread in TclThreadManager that is used for the IRC connection
    4747
    4848    SetConsoleCommand("IRC", "say",  &IRC::say);
  • code/branches/cpp11_v2/src/libraries/core/input/InputPrereqs.h

    r8729 r10994  
    454454        OrxEnumConstructors(InputStatePriority);
    455455
    456         static const int Empty        = -1;
    457         static const int Dynamic      = 0;
    458 
    459         static const int HighPriority = 1000;
    460         static const int Console      = HighPriority + 0;
    461         static const int Calibrator   = HighPriority + 1;
    462         static const int Detector     = HighPriority + 2;
     456        static constexpr int Empty        = -1;
     457        static constexpr int Dynamic      = 0;
     458
     459        static constexpr int HighPriority = 1000;
     460        static constexpr int Console      = HighPriority + 0;
     461        static constexpr int Calibrator   = HighPriority + 1;
     462        static constexpr int Detector     = HighPriority + 2;
    463463    };
    464464}
Note: See TracChangeset for help on using the changeset viewer.