Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken backward compability: libBoost 1.66 -> libBoost 1.67 #74

Open
PiotrZSL opened this issue May 18, 2019 · 1 comment
Open

Broken backward compability: libBoost 1.66 -> libBoost 1.67 #74

PiotrZSL opened this issue May 18, 2019 · 1 comment

Comments

@PiotrZSL
Copy link

Problematic code:

#include <boost/optional/optional.hpp>

struct A
{
    A(int a) : a(a) {}

    int a;
};

 #define TRUE 1

int main()
{
    return boost::optional<A>(TRUE , 5)->a;
}

libBoost 1.66 calls here:
optional ( bool cond, rval_reference_type val )
boost::optional(1, A(5));
and returns 5,

libBoost 1.67 and newer calls here:
template
explicit optional ( Expr&& expr,
BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate<T, Expr>, bool>::type = true
)
and returns 1.

This is change of behavior without any warring.

@akrzemi1
Copy link
Member

Thanks for reporting this. I just want to let you know that I recorded this issue. I am too busy at the moment to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants