Merge branch 'master' into jgrpp
# Conflicts: # src/airport_gui.cpp # src/build_vehicle_gui.cpp # src/direction_type.h # src/gfx_type.h # src/group_gui.cpp # src/misc_gui.cpp # src/rail_gui.cpp # src/road_gui.cpp # src/signs_gui.cpp # src/slope_func.h # src/smallmap_gui.cpp # src/terraform_gui.cpp # src/toolbar_gui.cpp # src/town_gui.cpp # src/town_type.h # src/vehicle_type.h # src/widget_type.h
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
inline constexpr enum_type& operator ^= (enum_type& m1, enum_type m2) {m1 = m1 ^ m2; return m1;} \
|
||||
inline constexpr enum_type operator ~(enum_type m) {return (enum_type)(~(std::underlying_type<enum_type>::type)m);}
|
||||
|
||||
/** Operator that allows this enumeration to be added to any other enumeration. */
|
||||
#define DECLARE_ENUM_AS_ADDABLE(EnumType) \
|
||||
template <typename OtherEnumType, typename = typename std::enable_if<std::is_enum_v<OtherEnumType>, OtherEnumType>::type> \
|
||||
constexpr OtherEnumType operator + (OtherEnumType m1, EnumType m2) { \
|
||||
return static_cast<OtherEnumType>(static_cast<typename std::underlying_type<OtherEnumType>::type>(m1) + static_cast<typename std::underlying_type<EnumType>::type>(m2)); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Informative template class exposing basic enumeration properties used by several
|
||||
|
@@ -57,13 +57,13 @@ struct RectPadding {
|
||||
* Get total horizontal padding of RectPadding.
|
||||
* @return total horizontal padding.
|
||||
*/
|
||||
inline uint Horizontal() const { return this->left + this->right; }
|
||||
constexpr uint Horizontal() const { return this->left + this->right; }
|
||||
|
||||
/**
|
||||
* Get total vertical padding of RectPadding.
|
||||
* @return total vertical padding.
|
||||
*/
|
||||
inline uint Vertical() const { return this->top + this->bottom; }
|
||||
constexpr uint Vertical() const { return this->top + this->bottom; }
|
||||
};
|
||||
|
||||
inline const RectPadding RectPadding::zero{};
|
||||
|
Reference in New Issue
Block a user