summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-01-03 15:06:33 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-01-04 12:10:27 -0800
commit4d6c5b2d3b982c7836ea3bf32d5ee8d0c4c699f8 (patch)
tree36d6f6b5ecfc7cb6979df04c4c2a1bfa6ee081bb /include/mbgl/util
parentb38710541941797c2937ea262e9905abccf56287 (diff)
downloadqtlocation-mapboxgl-4d6c5b2d3b982c7836ea3bf32d5ee8d0c4c699f8.tar.gz
[core] Remove constexpr from Color
GCC can't cope with it.
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/color.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/mbgl/util/color.hpp b/include/mbgl/util/color.hpp
index 178d0dc758..18e4747069 100644
--- a/include/mbgl/util/color.hpp
+++ b/include/mbgl/util/color.hpp
@@ -10,8 +10,8 @@ namespace mbgl {
// Stores a premultiplied color, with all four channels ranging from 0..1
class Color {
public:
- constexpr Color() = default;
- constexpr Color(float r_, float g_, float b_, float a_)
+ Color() = default;
+ Color(float r_, float g_, float b_, float a_)
: r(r_), g(g_), b(b_), a(a_) {
assert(r_ >= 0.0f);
assert(r_ <= 1.0f);
@@ -28,25 +28,25 @@ public:
float b = 0.0f;
float a = 0.0f;
- static constexpr Color black() { return { 0.0f, 0.0f, 0.0f, 1.0f }; };
- static constexpr Color white() { return { 1.0f, 1.0f, 1.0f, 1.0f }; };
+ static Color black() { return { 0.0f, 0.0f, 0.0f, 1.0f }; };
+ static Color white() { return { 1.0f, 1.0f, 1.0f, 1.0f }; };
- static constexpr Color red() { return { 1.0f, 0.0f, 0.0f, 1.0f }; };
- static constexpr Color green() { return { 0.0f, 1.0f, 0.0f, 1.0f }; };
- static constexpr Color blue() { return { 0.0f, 0.0f, 1.0f, 1.0f }; };
+ static Color red() { return { 1.0f, 0.0f, 0.0f, 1.0f }; };
+ static Color green() { return { 0.0f, 1.0f, 0.0f, 1.0f }; };
+ static Color blue() { return { 0.0f, 0.0f, 1.0f, 1.0f }; };
static optional<Color> parse(const std::string&);
};
-constexpr bool operator==(const Color& colorA, const Color& colorB) {
+inline bool operator==(const Color& colorA, const Color& colorB) {
return colorA.r == colorB.r && colorA.g == colorB.g && colorA.b == colorB.b && colorA.a == colorB.a;
}
-constexpr bool operator!=(const Color& colorA, const Color& colorB) {
+inline bool operator!=(const Color& colorA, const Color& colorB) {
return !(colorA == colorB);
}
-constexpr Color operator*(const Color& color, float alpha) {
+inline Color operator*(const Color& color, float alpha) {
assert(alpha >= 0.0f);
assert(alpha <= 1.0f);
return {