Commit 08dc8d0e authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: Tuple2 construct null with uninitialized value

Had this:

    Tuple2() {}

Instead of:

    Tuple2() : f_(), s_() {}

which is the same as

    Tuple2() = default;

This meant that Tuple2<scalar, scalar>() was not being zero-initialized
parent 26d0d48f
......@@ -61,8 +61,8 @@ public:
// Constructors
//- Null constructor
inline Pair();
//- Construct null
Pair() = default;
//- Construct from components
inline Pair(const T& f, const T& s);
......
......@@ -45,11 +45,6 @@ inline int Foam::Pair<T>::compare(const Pair<T>& a, const Pair<T>& b)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T>
inline Foam::Pair<T>::Pair()
{}
template<class T>
inline Foam::Pair<T>::Pair(const T& f, const T& s)
{
......
......@@ -57,7 +57,7 @@ inline Ostream& operator<<(Ostream& os, const Tuple2<Type1, Type2>& t2);
/*---------------------------------------------------------------------------*\
class Tuple2 Declaration
Class Tuple2 Declaration
\*---------------------------------------------------------------------------*/
template<class Type1, class Type2>
......@@ -81,9 +81,8 @@ public:
// Constructors
//- Null constructor for lists and hashes
inline Tuple2()
{}
//- Construct null
inline Tuple2() = default;
//- Construct from components
inline Tuple2(const Type1& f, const Type2& s)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment