/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
#include <folly/Lazy.h>
-#include <map>
#include <functional>
#include <iostream>
+#include <map>
-#include <gtest/gtest.h>
+#include <folly/portability/GTest.h>
namespace folly {
int computeCount = 0;
auto const val = folly::lazy([&]() -> int {
- EXPECT_EQ(++computeCount, 1);
+ ++computeCount;
+ EXPECT_EQ(computeCount, 1);
return 12;
});
EXPECT_EQ(computeCount, 0);
auto globalCount = folly::lazy([]{ return 0; });
auto const foo = folly::lazy([]() -> std::string {
- EXPECT_EQ(++globalCount(), 1);
+ ++globalCount();
+ EXPECT_EQ(globalCount(), 1);
return std::string("YEP");
});
struct CopyCount {
CopyCount() {}
CopyCount(const CopyCount&) { ++count; }
- CopyCount(CopyCount&&) {}
+ CopyCount(CopyCount&&) noexcept {}
static int count;
EXPECT_EQ(lz(), 12);
}
-}
-
+} // namespace folly