Commit 591b9f3e authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 3

Construct TestObject in AtomicLinkedListTest via a const reference

Summary:
MSVC doesn't currently guarantee left-to-right argument evaluation order for values constructed via braced initializers, and produces a warning if you try to pass an argument with a non-trivial copy constructor by-value in a constructor used by the braced initializer.
This prevents the warning by simply accepting a const reference instead.

Reviewed By: yfeldblum

Differential Revision: D3705073

fbshipit-source-id: 917ec1bb776d6ec4bfefe50907d4c5ac2f2379b1
parent ca86990b
...@@ -153,7 +153,8 @@ TEST(AtomicIntrusiveLinkedList, Stress) { ...@@ -153,7 +153,8 @@ TEST(AtomicIntrusiveLinkedList, Stress) {
class TestObject { class TestObject {
public: public:
TestObject(size_t id__, std::shared_ptr<void> ptr) : id_(id__), ptr_(ptr) {} TestObject(size_t id__, const std::shared_ptr<void>& ptr)
: id_(id__), ptr_(ptr) {}
size_t id() { size_t id() {
return id_; return id_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment