Boost C++ Libraries: Ticket #7145: rational.hpp - Avoid repeated construction https://svn.boost.org/trac10/ticket/7145 <p> In rational.hpp, two times '<a class="missing wiki">IntType</a> zero(0);' is used to "Avoid repeated construction" and two times 'int_type const zero( 0 );' is used. The two without the const may not be avoiding repeated construction. Since int_type is just a typedef from <a class="missing wiki">IntType</a>, it might be clearer if all int_type were replaced with <a class="missing wiki">IntType</a> and the typedef for int_type removed. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7145 Trac 1.4.3 Daryle Walker Tue, 20 Aug 2013 11:30:43 GMT <link>https://svn.boost.org/trac10/ticket/7145#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7145#comment:1</guid> <description> <p> When a class template's instantiation is hidden behind a <code>typedef</code>/type-alias, its template parameters are a pain to get. That's why it's customary for template classes to provide means to get its parameters within themselves. That means member type-aliases for type-based parameters and constants or static member functions for value-based parameters. (Maybe the new C++11 templated <code>using</code> can be used for template-based parameters?) </p> <p> Maybe I should go the other way; use <code>int_type</code> for member function definitions, and <code>IntType</code> only within non-member functions. </p> </description> <category>Ticket</category> </item> </channel> </rss>