Boost C++ Libraries Home Libraries People FAQ More


Optional references

This library allows the template parameter T to be of reference type: T&, and to some extent, T const&.

However, since references are not real objects some restrictions apply and some operations are not available in this case:

Also, even though optional<T&> treats it wrapped pseudo-object much as a real value, a true real reference is stored so aliasing will ocurr: