Boost logo

Boost Users :

From: Daniel Krügler (dsp_at_[hidden])
Date: 2005-09-01 01:51:47


I observed some further missing definitions of constant static
members of integral type, which have been initialized in-class:

1) additive_combine.hpp
Proposal: Add the following

#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class MLCG1, class MLCG2,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
    typename MLCG1::result_type
#else
    int32_t
#endif
    val>
const bool additive_combine<MLCG1, MLCG2, val>::has_fixed_range;

template<class MLCG1, class MLCG2,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
    typename MLCG1::result_type
#else
    int32_t
#endif
    val>
    const typename additive_combine<MLCG1, MLCG2, val>::result_type
additive_combine<MLCG1, MLCG2, val>::min_value;

template<class MLCG1, class MLCG2,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
    typename MLCG1::result_type
#else
    int32_t
#endif
    val>
    const typename additive_combine<MLCG1, MLCG2, val>::result_type
additive_combine<MLCG1, MLCG2, val>::max_value;
#endif

2) What is actually the reason for the trailing whitespace on streaming
of the class template discard_block? It seems inconsistent compared to
the other outputs.

3) linear_congruential.hpp:
Add missing static member definitions for linear_congruential:

#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
... // Other already defined constants
template<class IntType, IntType a, IntType c, IntType m, IntType val>
const IntType linear_congruential<IntType,a,c,m,val>::multiplier;
#endif

.. and for class rand48 (in its corresponding cpp, not the header):
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
... // Other already defined constants
const bool rand48::has_fixed_range;
const int32_t rand48::min_value;
const int32_t rand48::max_value
#endif

Greetings from Bremen,

Daniel Krügler


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net