C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::contains_mutable

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Sat, 1 Jul 2023 19:03:13 +0200
Changing a mutable counts as read-only access from the view from outside the class.   You think of non-mutable const accesses to be implicitly thread-safe?   You could possibly reintroduce volatile member functions as thread-safe interface?   C++: Been there, tried that?   -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Sa 01.07.2023 17:23 Betreff:[std-proposals] std::contains_mutable An:std-proposals <std-proposals_at_[hidden]>; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>;  This week I posted on here about my 'Reserved' class that works very similarly to 'boost::synchronized_value', and today I was thinking that I would change the mutex to a shared_mutex, and add a new method, 'ReserveReadOnly' to go alongside the 'Reserve'.  But then I thought that this could malfunction if the class contained any mutable members.  So I think in <type_traits>, we should have 'std::contains_mutable'.   -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2023-07-01 17:03:15