
Hi all, simple patch to make const the private member m_threshold in class barrier Regards Gaetano --- barrier.hpp.original 2011-12-22 12:05:05.921720854 +0100 +++ barrier.hpp 2011-12-22 12:05:36.936205847 +0100 @@ -52,7 +52,7 @@ private: mutex m_mutex; condition_variable m_cond; - unsigned int m_threshold; + const unsigned int m_threshold; unsigned int m_count; unsigned int m_generation; };

Gaetano Mendola wrote:
Hi all, simple patch to make const the private member m_threshold in class barrier
Could you please mention the name of the concerned library in the subject line (such as [thread])? Care to explain which problem your patch solves? (In case it is a "real" problem, you might be asked to also open a track ticket for the issue.) Making a non-static member variable const can affect the semantics of the entire class. It is not clear to me whether this is also the case here, and whether this would be intended. Regards, Thomas

On 12/22/2011 12:35 PM, Thomas Klimpel wrote:
Gaetano Mendola wrote:
Hi all, simple patch to make const the private member m_threshold in class barrier
Could you please mention the name of the concerned library in the subject line (such as [thread])?
Next time I will.
Care to explain which problem your patch solves? (In case it is a "real" problem, you might be asked to also open a track ticket for the issue.) Making a non-static member variable const can affect the semantics of the entire class. It is not clear to me whether this is also the case here, and whether this would be intended.
There is no real problem, I was inspecting that class for other reasons, and I saw that a private member not meant to be changed during the life-cycle of the class is not marked const. You can easily see it, the member m_threshold is meant to save the threshold value across different generation in order to reset the barrier to the original status. Regards Gaetano

Gaetano Mendola-3 wrote
On 12/22/2011 12:35 PM, Thomas Klimpel wrote:
Gaetano Mendola wrote:
Hi all, simple patch to make const the private member m_threshold in class barrier
Could you please mention the name of the concerned library in the subject line (such as [thread])?
Next time I will.
Care to explain which problem your patch solves? (In case it is a "real" problem, you might be asked to also open a track ticket for the issue.) Making a non-static member variable const can affect the semantics of the entire class. It is not clear to me whether this is also the case here, and whether this would be intended.
There is no real problem, I was inspecting that class for other reasons, and I saw that a private member not meant to be changed during the life-cycle of the class is not marked const. You can easily see it, the member m_threshold is meant to save the threshold value across different generation in order to reset the barrier to the original status.
Hi, please could you create a ticket so thqt we don“t forget it? Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/constness-in-barrier-hpp-tp4224857p422860... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (3)
-
Gaetano Mendola
-
Thomas Klimpel
-
Vicente Botet