[bind10-dev] std::make_pair

Jelte Jansen jelte at isc.org
Mon Oct 8 14:12:43 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/08/2012 11:53 AM, Francis Dupont wrote:
> The last Visual Studio changed the type of std::make_pair (cf 
> http://connect.microsoft.com/VisualStudio/feedback/details 
> 691756/std-make-pair-error-in-vc11 ) In fact the argument is not 
> silly so I suggest to add a note in coding guidelines explaining 
> the make_pair<A,B>(x, y) construct is bad. BTW I can't find one in 
> the bind10 code but there are two in botan (so I suggest too a bug 
> report to the botan team).
> 

OK, I'll add it unless someone is opposed. We do indeed not use the
explicit construct atm.

So this breaks botan builds on windows? (I really need to take some
time and set up visualstudio)

I scanned through the Botan sources (10.1), and found 4 occurrences.
However, one of those was actually ifdef'd (replacing a normal use of
make_pair, i.e. without the types), an according to the comment it is
there because of a probem in sunstudio. It does not provide any
further context, but it may be relevant.

(in src/utils/stl_util.h)

#if defined(BOTAN_BUILD_COMPILER_IS_SUN_STUDIO)
   // Work around a strange bug in Sun Studio
   multimap.insert(std::make_pair<const K, V>(key, value));
#else
   multimap.insert(std::make_pair(key, value));
#endif


Jelte
ooi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBy31sACgkQ4nZCKsdOncXtiQCfWRi7cGkDi28F3FDJiGnF8bjz
VJMAnRA8idRrTCglBZvML+C4OyEpIA+W
=1Pct
-----END PGP SIGNATURE-----


More information about the bind10-dev mailing list