Add reminders that these classes have constexpr default constructors.
authormtklein <mtklein@chromium.org>
Fri, 29 Apr 2016 20:58:18 +0000 (13:58 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 29 Apr 2016 20:58:18 +0000 (13:58 -0700)
We can do this now that we can write "constexpr".

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936653002

Review-Url: https://codereview.chromium.org/1936653002

include/private/SkOnce.h
include/private/SkSpinlock.h

index 1c68fb7..507dcb5 100644 (file)
@@ -19,6 +19,8 @@
 
 class SkOnce {
 public:
+    constexpr SkOnce() = default;
+
     template <typename Fn, typename... Args>
     void operator()(Fn&& fn, Args&&... args) {
         auto state = fState.load(std::memory_order_acquire);
index 2744206..a5d3782 100644 (file)
@@ -13,6 +13,8 @@
 
 class SkSpinlock {
 public:
+    constexpr SkSpinlock() = default;
+
     void acquire() {
         // To act as a mutex, we need an acquire barrier when we acquire the lock.
         if (fLocked.exchange(true, std::memory_order_acquire)) {