Boost C++ Libraries: Ticket #10316: Thread: add subscription operator if the value provide it. https://svn.boost.org/trac10/ticket/10316 <p> I would like to be able to do </p> <pre class="wiki"> typedef boost::synchronized_value&lt; boost::container::flat_map&lt;int, int&gt; &gt; ValueIndex; ValueIndex index; index[0] = 1; </pre><p> and would expect that last line to be equivalent to </p> <pre class="wiki"> auto locked_index = index.synchronize(); (*locked_index)[0] = 1; </pre><p> </p> <p> I'm not totally sure it's possible to do but it would help. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10316 Trac 1.4.3 viboes Thu, 21 Aug 2014 08:00:45 GMT description changed https://svn.boost.org/trac10/ticket/10316#comment:1 https://svn.boost.org/trac10/ticket/10316#comment:1 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/10316?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket viboes Thu, 21 Aug 2014 08:01:09 GMT owner, status changed https://svn.boost.org/trac10/ticket/10316#comment:2 https://svn.boost.org/trac10/ticket/10316#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Sun, 28 Sep 2014 22:52:25 GMT <link>https://svn.boost.org/trac10/ticket/10316#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10316#comment:3</guid> <description> <p> The statement </p> <pre class="wiki">index[0] = 1; </pre><p> concerns two operations, the operator[] which returns a reference and the assignment operator. </p> <p> In order to make this work we will need to use expression templates </p> <p> operator[] would return a proxy reference, let call it at_type, that must store a reference to the synchronized_value instance and the index. </p> <p> We would need to overload the assignment operator on at_type so that it can do what you want as an atomic operation. </p> <p> I have not too much time to implement this kind of cosmetic features, but a patch would be welcome. Do you think that you can do it? </p> </description> <category>Ticket</category> </item> <item> <author>mjklaim@…</author> <pubDate>Mon, 29 Sep 2014 08:19:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10316#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10316#comment:4</guid> <description> <p> I started to consider how to do it at the time I wrote this but right now I'm overloaded with work. I'll try a patch asap but not immediately. </p> </description> <category>Ticket</category> </item> </channel> </rss>