Boost logo

Boost Users :

Subject: [Boost-users] [signals2] Warn unused result
From: Deven (drt80d_at_[hidden])
Date: 2018-08-24 04:06:50


I am using boost::signals2 library for event callback mechanism. The
event register callback function returns a
boost::signals2::scope_connection object for optional disconnect by the
function registering itself.

I want to mandate using the returns result (scoped_connection) object by
the user. So, I use the gcc attribute "__attribute__( (
warn_unused_result ) )" with the function.

The problem is that the compiler does not warn for unused result. Any
ideas, why would this happen?

I am using Linux with g++ 4.8.4 and c++11 is enabled.

Boost version: 1.67.0

I have attached a minimal working example.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at