Re: [Boost-bugs] [Boost C++ Libraries] #5580: BOOST_PP_MUL documentation regarding efficiency is confusing

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5580: BOOST_PP_MUL documentation regarding efficiency is confusing
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-13 12:10:01


#5580: BOOST_PP_MUL documentation regarding efficiency is confusing
-------------------------------------+-------------------------------------
  Reporter: Jeffrey Lee Hellrung, | Owner: no-maintainer
  Jr. <jeffrey.hellrung@…> | Status: new
      Type: Bugs | Component: preprocessor
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.46.1 | Keywords: preprocessor
Resolution: | BOOST_PP_MUL
-------------------------------------+-------------------------------------

Comment (by Alex Cole <alex.cole@…>):

 I've done some digging, and it seems BOOST_PP_ADD internally works by
 decrementing the second parameter while incrementing the first parameter
 in a BOOST_PP_WHILE loop until the second parameter is zero. I'm not the
 author, but this to me implies that having the second parameter likely to
 be smaller is the most efficient method, as it will result in slightly
 less iterations.

 So by my reading of the code, the second statement that "In other words, x
 should be the value that is most likely to be the largest of the two
 operands." is the correct one.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5580#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC