Lines Matching refs:val2
19 Any val2 = val;
21 EXPECT_TRUE(val2.IsEmpty());
34 Any val2(3.1415926);
35 EXPECT_FALSE(val2.IsEmpty());
36 EXPECT_TRUE(val2.IsTypeCompatible<double>());
37 EXPECT_FALSE(val2.IsTypeCompatible<int>());
38 EXPECT_DOUBLE_EQ(3.1415926, val2.Get<double>());
66 Any val2;
67 EXPECT_TRUE(val2.IsEmpty());
68 val2 = val;
70 EXPECT_FALSE(val2.IsEmpty());
72 EXPECT_EQ("blah", val2.Get<std::string>());
75 EXPECT_EQ("blah", val2.Get<std::string>());
76 val2.Clear();
77 EXPECT_TRUE(val2.IsEmpty());
85 val2 = std::move(val);
87 EXPECT_TRUE(val2.IsTypeCompatible<std::vector<int>>());
88 EXPECT_EQ(3, val2.Get<std::vector<int>>().size());
90 val = val2;
92 EXPECT_TRUE(val2.IsTypeCompatible<std::vector<int>>());
94 EXPECT_EQ(3, val2.Get<std::vector<int>>().size());
201 Any val2(std::cref(a)); // const int&
202 EXPECT_EQ(7, val2.Get<std::reference_wrapper<const int>>().get());
206 EXPECT_EQ(10, val2.Get<std::reference_wrapper<const int>>().get());
215 Any val2 = val;
221 EXPECT_EQ("Jack", val2.Get<Person>().name);
222 EXPECT_EQ(40, val2.Get<Person>().age);
227 Any val2(2.7);
229 EXPECT_EQ(2.7, val2.Get<double>());
231 val.Swap(val2);
233 EXPECT_EQ(12, val2.Get<int>());
235 std::swap(val, val2);
237 EXPECT_EQ(2.7, val2.Get<double>());