| Home | Libraries | People | FAQ | More

## Release Notes

#### Boost Release 1.87

- Breaking change. Dropped support for C++03. C++11 is now the required minimum; at least some C++11 features.
- Dropped dependency on Boost.Utility.
- Dropped dependency on Boost.Predef.
- Dropped dependency on Boost.StaticAssert.
- Dropped dependency on Boost.Move.
- A bit faster implementation of some relational operations.
- Warning. In the future releases we intend to introduce the range interface into `optional`, so that `std::ranges::range<optional<T>>` will be `true`. This may affect the overload resolution in programs that make decisions based on predicates such as `std::ranges::range`.
- Tags `in_place_init` and `in_place_init_if` become `inline constexpr` and therewith leave smaller footprint in the executable. This addresses issue #103.

#### Boost Release 1.85

- Fixed the implementation for trivial types. Now it is slower, because it always initializes the `T`, but it avoids undefined behavior when `optional<T>` is copied. This fixes issue #108.
- Fixed some `-Wmaybe-uninitialized` warnings in GCC 12. Thanks to Christian Mazakas for the fix.
- Dropped dependency on Boost.Detail.

#### Boost Release 1.83

- Deprecated support for C++03 and earlier, C++11 will be required in release 1.86.

#### Boost Release 1.80

- Breaking change: Added specializations for `std::hash<boost::optional<T>>`. This fixes issue #55. You may get compiler errors when your program provides specializations for `std::hash<boost::optional<T>>`. If this happens, define macro `BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH` to suppress the specializations of `std::hash` in this library.

#### Boost Release 1.79

- Fixed issue #98.
- Fixed issue #92.
- Added support for `BOOST_NO_IOSTREAM`.
- Now aligned storage uses `unsigned char` rather than `char` to avoid UB.
- Now using cv-unqualified `value_type` with placement `new` to avoid UB.

#### Boost Release 1.76

- Fixed MSVC warning C4702.

#### Boost Release 1.75

- `boost::none` is `constexpr`-declared.
- Fixed issue #78.

#### Boost Release 1.73

- Fixed issue #78.
- `boost::none` is now declared as an inline variable (on compilers that support it): there is only one instance of `boost::none` across all translation units.
- Fixed a number of compilation errors in GCC 4.4.7 in `optional<T>` for trivial `T`s. Thanks to Robert Leahy for the fix. For details see pr #78.
- Now suppressing warning `-Wweak-vtables`.

#### Boost Release 1.69

- Remove deprecation mark from `reset()` method (without arguments).
- Fixed issue #59.
- Fixed bug with initialization of certain wrapper types in clang with -std=c++03. See pr #64.

#### Boost Release 1.68

- Added member function `has_value()` for compatibility with `std::optional` (issue #52).
- Added member function `map()` for transforming `optional<T>` into `optional<U>` using a function of type `T -> U`.
- Added member function `flat_map()` for transforming `optional<T>` into `optional<U>` using a function of type `T -> optional<U>`.

#### Boost Release 1.67

- Fixed issue #46.
- Fixed `-Wzero-as-null-pointer-constant` warnings.

#### Boost Release 1.66

- On newer compilers `optional` is now trivially-copyable for scalar `T`s. This uses a different storage (just `T` rather than `aligned_storage`). We require the compiler to support defaulted functions.
- Changed the implementation of `operator==` to get rid of the `-Wmaybe-uninitialized` false-positive warning from GCC.

#### Boost Release 1.63

- Added two new in-place constructors. They work similarly to `emplace()` functions: they initialize the contained value by perfect-forwarding the obtained arguments. One constructor always initializes the contained value, the other based on a boolean condition.
- Syntax `o = {}` now correctly un-initializes optional, just like in `std::optional`.
- Fixed Trac #12203.
- Fixed Trac #12563.

#### Boost Release 1.62

- Fixed Trac #12179.

#### Boost Release 1.61

- Now `boost::optional` is specialized for reference parameters. This addresses a couple of issues:
  - the `sizeof` of optional reference is that of a pointer,
  - some bugs connected to copying optional references are gone,
  - all run-time bugs caused by incorrect reference binding on some compilers are now turned into compile-time errors,
  - you can swap optional references: it is like swapping pointers: shallow, underlying objects are not affected,
  - optional references to abstract types work.
- Documented nested typedefs (Trac #5193).
- Made the perfect-forwarding constructor SFINAE-friendly, which fixes Trac #12002. However, this only works in the newer platforms that correctly implement C++11 `<type_traits>`.
- Fixed Trac #10445.

#### Boost Release 1.60

- Changed the implementation of `boost::none` again. Now it is a const object with internal linkage (as any other tag). This fixes Trac #11203.

#### Boost Release 1.59

- For C++03 compilers, added 0-argument overload for member function `emplace()`, and therewith removed the dependency on `<boost/utility/in_place_factory.hpp>`.
- Fixed Trac #11241.

#### Boost Release 1.58

- `boost::none_t` is no longer convertible from literal `0`. This avoids a bug where `optional<rational<int>> oi = 0;` would initialize an optional object with no contained value.
- Improved the trick that prevents streaming out `optional` without header `optional_io.hpp` by using safe-bool idiom. This addresses Trac #10825.
- IOStream operators are now mentioned in documentation.
- Added a way to manually disable move semantics: just define macro `BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES`. This can be used to work around Trac #10399.
- It is no longer possible to assign `optional<U>` to `optional<T>` when `U` is not assignable or convertible to `T` (Trac #11087).
- Value accessors now work correctly on rvalues of `optional<T&>` (Trac #10839).

#### Boost Release 1.57

- Git pull #9: "Supply `<string>` to fix C++03 compile error on `logic_error("...")`".

#### Boost Release 1.56

- Added support for rvalue references. Now `optional<T>` works with moveable but non-copyable `T`'s,
- Improved `swap` (now uses move operations),
- Added function `emplace()`. This is the last of the requests from Trac #1841,
- `optional` is moveable, including conditional `noexcept` specifications, which make it `move_if_noexcept`-friendly,
- Using explicit operator bool() on platforms that support it (Trac #4227) (breaking change),
- Forward declaration of `operator<<(ostream&, optional const&)` to prevent inadvertent incorrect serialization of optional objects,
- Removed deprecated function `reset()` from examples (Trac #9005),
- Equality comparison with `boost::none` does not require that `T` be EqualityComparable,
- Optional rvalue references are explicitly disallowed,
- Binding temporaries to optional references is explicitly disallowed (breaking change),
- More ways to access the contained value, functions `value()`, `value_or()`, `value_or_eval()`,
- Updated and reorganized documentation, added tutorial and quick guide sections.