Hi list,<br><br>In 'classic' C++ style I have signalled optional parameters in a function with pointers that might be null (I wouldn't like to create overloads for all possible combination of existing and non-existing parameters) e.g.<br> <br>// p1 is mandatory, p2, p3 and p4 are optional<br>void f(const Param1& p1, const Param2* p2, const Param3* p3, const Param4* p4);<br><br>And call it <br>Param1p1; Param2 p2; Param4 p4;<br>f(p1, &p2, 0, &p4);<br> <br>I thought I could use boost::optional like this<br><br>void f(const Param1& p1, const boost::optional<Param2> & p2, const boost::optional<Param3> p3, const boost::optional<Param4> & p4);<br> <br>And call it <br> Param1p1; Param2 p2; Param4 p4;<br> f(p1, boost::optional<Param2>(p2), boost::optional<Param3>(), boost::optional<Param4>(p4) );<br> <br>but I haven't seen this usage in the examples in the documentation of Boost.Optional.<br><br>Is this usage correct? Are there any hidden drawbacks with this approach?<br><br>TIA<br><br>