[OpenWalnut-Dev] Switching to C++11

Sebastian Eichelbaum openwalnut at nemtics.com
Mon Aug 17 14:11:44 CEST 2015


Hi

Please replace

"return m_signalLeftButtonPush( ... )" 

with

"return ( true == m_signalLeftButtonPush( ... ) )"

According to the Boost doc, boost::optional allows implicit cast only on 
non-c++11 compilers. ... obviously new in boost > 1.55 since I do not 
experience this issue.

Best,
Sebastian

On Mon, 17 Aug 2015, Mathias Goldau wrote:

>On Mac I have the following compilation error:
>
>/Users/math/repos/ow/src/modules/clusterDisplay/WMClusterDisplay.cpp:60:16: error: no viable conversion from 'result_type'
>      (aka 'boost::optional<bool>') to 'bool'
>        return m_signalLeftButtonPush( WVector2f( ea.getX(), ea.getY() ) );
>               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>The corresponding code is the first return stmt below:
>
>bool WMClusterDisplay::MainViewEventHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /* aa */ )
>{
>    //    wlog::debug( "WMClusterDisplay::MainViewEventHandler" ) << "handle";
>    if( ea.getEventType() == GUIEvents::PUSH && ea.getButton() == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
>    {
>        return m_signalLeftButtonPush( WVector2f( ea.getX(), ea.getY() ) );
>    }
>    return false;
>}
>
>Where the header says:
>
>typedef boost::signals2::signal< bool ( WVector2f ) > LeftButtonPushSignalType;
>[…]
>LeftButtonPushSignalType m_signalLeftButtonPush;
>
>I am not sure what the problem is and how to fix it. Do we need special boost version? Currently I use: 1.58.0. All compiled with clang. The GCC I cannot test here, as all my libs are linked against the stdlib from clang which is not compatible with gcc’s stdlib.
>
>best-
>Mathias
>
>> Am 16.08.2015 um 12:32 schrieb Sebastian Eichelbaum <openwalnut at nemtics.com>:
>>
>> Hi List,
>>
>> I have pushed several changes (Release Branch) to make OW compile with --std=c++11 compiler flag. The issues where mainly related to implicit casts of shared_ptr to bools (something like "dataValid = ( dataSet )"). I changed this to "dataValid = ( dataSet != NULL )". Although this is not the C++11 way (we should use nullptr), it keeps compatibility with c++98 for now, as we are not yet sure if everything is fine on OSX (Linux + Windows was tested by me. Works with Clang).
>>
>> I would like to ask you to compile OW again. Please also test GCC and OSX.
>>
>> If everything is fine, we stick with c++11.
>>
>> Best
>> Sebastian
>>
>> --
>> Dr. rer. nat. Sebastian Eichelbaum
>> Nemtics Visualization - Software | Training | Consulting
>> http://www.nemtics.com
>> sebastian.eichelbaum at nemtics.com
>> +49 176 34541337
>> Gohliser Straße 20 - D-04105 Leipzig
>> _______________________________________________
>> OpenWalnut-Dev mailing list
>> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
>> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
>>
>> Archive: http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/
>>
>

>_______________________________________________
>OpenWalnut-Dev mailing list
>OpenWalnut-Dev at lists.informatik.uni-leipzig.de
>http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
>
>Archive: http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/


-- 
Dr. rer. nat. Sebastian Eichelbaum
Nemtics Visualization - Software | Training | Consulting
http://www.nemtics.com
sebastian.eichelbaum at nemtics.com
+49 176 34541337
Gohliser Straße 20 - D-04105 Leipzig


More information about the OpenWalnut-Dev mailing list