This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Hide _S_n_primes from user code
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 Apr 2015 12:31:55 +0100
- Subject: Re: Hide _S_n_primes from user code
- Authentication-results: sourceware.org; auth=none
- References: <5537F904 dot 4010405 at gmail dot com> <55380079 dot 3000105 at gmail dot com>
On 22/04/15 22:11 +0200, François Dumont wrote:
+ constexpr auto __n_primes
+ = sizeof(__prime_list) / sizeof(unsigned long) - 1;
Normally I'd say
sizeof(__prime_list) / sizeof(*__prime_list) - 1
would be better, but since it's very unlikely we'll change the element
type in the array what you have should be safe.
OK for trunk.