Boost C++ Libraries: Ticket #11336: units: base_unit_info name and symbol unavailable for absolute units https://svn.boost.org/trac10/ticket/11336 <p> absolute&lt;&gt; works for making temperatures absolute. However, it does not define a specialisation of the base_unit_info, so name_string and symbol_string are unavailable and some methods fails as a result. </p> <p> Please consider making absolute&lt;&gt; provide a base_unit_info specialisation which delegates to the wrapped unit type's base_unit_info, but adds an "absolute " prefix to both and can replace the ostream operator which works partially for the symbol case, but not the unit name which is completely absent. This will make absolute&lt;&gt; behave the same as a normal unwrapped unit. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11336 Trac 1.4.3 Steven Watanabe Fri, 22 May 2015 22:25:50 GMT <link>https://svn.boost.org/trac10/ticket/11336#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11336#comment:1</guid> <description> <p> absolute is not a base_unit, so this is not the correct fix. Can you provide a small test case the demonstrates the problem? The test for output seems to be passing for absolute with both symbols and unit names. </p> </description> <category>Ticket</category> </item> <item> <author>Roger Leigh <rleigh@…></author> <pubDate>Mon, 25 May 2015 11:23:45 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/11336 https://svn.boost.org/trac10/ticket/11336 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_abs_units.cpp</span> </li> </ul> <p> Example of failure to get unit name/symbol from absolute units </p> Ticket Roger Leigh <rleigh@…> Mon, 25 May 2015 11:31:20 GMT <link>https://svn.boost.org/trac10/ticket/11336#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11336#comment:2</guid> <description> <p> Hi Steven, </p> <p> I have attached an example file to demonstrate the problem. Uncomment the comments to get my workaround for getting it to compile and function, though I don't really like this. </p> <p> I'm not using base_unit_info directly; I'm using name_string and symbol_string from io.hpp, and these are failing with absolute units. I assumed these should work with all unit types for output, rather than being limited to base units. </p> <p> Kind regards, Roger </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Tue, 26 May 2015 15:42:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11336#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11336#comment:3</guid> <description> <p> So, the problem is that there aren't overloads of name_string/symbol_string for absolute. That's easy to fix. </p> </description> <category>Ticket</category> </item> <item> <author>Roger Leigh <rleigh@…></author> <pubDate>Tue, 26 May 2015 21:37:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11336#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11336#comment:4</guid> <description> <p> That could certainly be the case. Being so heavily templated, I wasn't entirely certain exactly where the boundary between internal implementation and public interface was. If it's as simple as overloading those methods, that's great. </p> <p> Would that also imply the absolute ostream operator&lt;&lt; could be removed since they would do its job? </p> </description> <category>Ticket</category> </item> </channel> </rss>