Home | History | Annotate | Download | only in utils

Lines Matching defs:optional

29 #include "utils/optional.ipp"
37 using utils::optional;
52 /// Constructs a new optional object.
90 /// Constructs and returns an optional object.
95 /// \tparam Type The type of the object included in the optional wrapper.
96 /// \param value The value to put inside the optional wrapper.
98 /// \return The constructed optional object.
100 optional< Type >
103 return optional< Type >(value);
113 const optional< int > no_args;
116 const optional< int > with_none(none);
119 const optional< int > with_arg(3);
123 const optional< int > copy_none(with_none);
126 const optional< int > copy_arg(with_arg);
135 const optional< std::string > no_args;
138 const optional< std::string > with_none(none);
141 const optional< std::string > with_arg("foo");
145 const optional< std::string > copy_none(with_none);
148 const optional< std::string > copy_arg(with_arg);
157 optional< int > from_default;
158 from_default = optional< int >();
161 optional< int > from_none(3);
165 optional< int > from_int;
174 optional< long > from_return(return_optional< long >(123));
185 optional< test_alloc > optional1(test_alloc(3));
190 optional< test_alloc > optional2(optional1);
210 optional< std::string > optional;
211 ATF_REQUIRE(&def_value == &optional.get_default(def_value));
212 optional = "bye";
213 ATF_REQUIRE_EQ("bye", optional.get_default(def_value));
220 optional< int > opt = utils::make_optional(576);
229 optional< int > opt1, opt2;
258 str << optional< int >(none);
263 str << optional< int >(5);
268 str << optional< std::string >("this is a text");