[Boost-bugs] [Boost C++ Libraries] #11270: bost::shared_ptr && boost::optional fail to compile in single if statement

Subject: [Boost-bugs] [Boost C++ Libraries] #11270: bost::shared_ptr && boost::optional fail to compile in single if statement
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-05 20:32:53


#11270: bost::shared_ptr && boost::optional fail to compile in single if statement
-------------------------+-------------------------------------------------
 Reporter: Vladimir | Type: Bugs
  Venediktov | Milestone: To Be Determined
   Status: new | Version: Boost 1.58.0
Component: None | Keywords: boost::shared_ptr &&
 Severity: Problem | boost::optional
-------------------------+-------------------------------------------------
 {{{
 /*
 using sun 12.4 with std=c++11 does not compile shared_ptr and optional in
 single if statement , example : if ( ptr && opt_value )
 giving following message : Error: The operation "boost::shared_ptr<int>
 && boost::optional<int>" is illegal

 boost version : 1.58

 compilation command :
 /appl/toolbox/solarisstudio12.4/bin/CC -std=c++11
 -I/home/vvenedik/C++/boost_1_58_0 -c main_5.cpp -o main_5.o
 */

 #include <boost/optional.hpp>
 #include <boost/shared_ptr.hpp>
 #include <iostream>


 int main() {

 boost::shared_ptr<int> ptr(new int) ;

 boost::optional<int> opt_int;

 opt_int = 5;


 if ( ptr && opt_int ) {
     std::cout << "compiled and ran OK" << std::endl;
 }

 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11270>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC