mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
putil: make ButtonHandle::none() constexpr
This commit is contained in:
parent
809f9b04f6
commit
11ecd3af87
@ -137,15 +137,6 @@ output(std::ostream &out) const {
|
|||||||
out << get_name();
|
out << get_name();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a special zero-valued ButtonHandle that is used to indicate no
|
|
||||||
* button.
|
|
||||||
*/
|
|
||||||
INLINE ButtonHandle ButtonHandle::
|
|
||||||
none() {
|
|
||||||
return _none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ButtonHandle::none() evaluates to false, everything else evaluates to true.
|
* ButtonHandle::none() evaluates to false, everything else evaluates to true.
|
||||||
*/
|
*/
|
||||||
|
@ -14,9 +14,6 @@
|
|||||||
#include "buttonHandle.h"
|
#include "buttonHandle.h"
|
||||||
#include "buttonRegistry.h"
|
#include "buttonRegistry.h"
|
||||||
|
|
||||||
// This is initialized to zero by static initialization.
|
|
||||||
ButtonHandle ButtonHandle::_none;
|
|
||||||
|
|
||||||
TypeHandle ButtonHandle::_type_handle;
|
TypeHandle ButtonHandle::_type_handle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +53,7 @@ PUBLISHED:
|
|||||||
|
|
||||||
constexpr int get_index() const;
|
constexpr int get_index() const;
|
||||||
INLINE void output(std::ostream &out) const;
|
INLINE void output(std::ostream &out) const;
|
||||||
INLINE static ButtonHandle none();
|
constexpr static ButtonHandle none() { return ButtonHandle(0); }
|
||||||
|
|
||||||
INLINE operator bool () const;
|
INLINE operator bool () const;
|
||||||
|
|
||||||
@ -65,7 +65,6 @@ PUBLISHED:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int _index;
|
int _index;
|
||||||
static ButtonHandle _none;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static TypeHandle get_class_type() {
|
static TypeHandle get_class_type() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user