docs: updated gotchas section

This commit is contained in:
Andrzej Krzemienski
2016-09-17 01:25:12 +02:00
parent 3e0051be7e
commit 62acbe1690
20 changed files with 458 additions and 84 deletions

View File

@@ -28,7 +28,7 @@ The implementation uses the following other Boost modules:
[endsect]
[section Optional Reference Binding]
[section Optional Reference Binding][#optional_reference_binding]
A number of compilers incorrectly treat const lvalues of integral type as rvalues, and create an illegal temporary when binding to an lvalue reference to const in some expressions. This could result in creating an optional lvalue reference that is in fact bound to an unexpected temporary rather than to the intended object. In order to prevent hard to find run-time bugs, this library performs compile-time checks to prevent expressions that would otherwise bind an optional reference to an unexpected temporary. As a consequence, on certain compilers certain pieces of functionality in optional references are missing. In order to maintain a portability of your code across diferent compilers, it is recommended that you only stick to the minimum portable interface of optional references: prefer direct-initialization and copy assignment of optional references to copy-initialization and assignment from `T&`: