Commit 2af40042 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Fix more compilation issues with g++ 4.6.1 and clang++.

	* mln/canvas/browsing/snake_vert.hh,
	* mln/fun/v2v/hsi_to_rgb.hh,
	* mln/fun/v2v/rgb_to_hsi.hh,
	* mln/fun/v2v/rgb_to_hsl.hh,
	* mln/literal/grays.hh,
	* mln/literal/identity.hh,
	* mln/literal/max.hh,
	* mln/literal/min.hh,
	* mln/literal/one.hh,
	* mln/literal/origin.hh,
	* mln/literal/zero.hh: Add default constructors.
parent 93ca680b
2011-11-23 Guillaume Lazzara <z@lrde.epita.fr>
Fix more compilation issues with g++ 4.6.1 and clang++.
* mln/canvas/browsing/snake_vert.hh,
* mln/fun/v2v/hsi_to_rgb.hh,
* mln/fun/v2v/rgb_to_hsi.hh,
* mln/fun/v2v/rgb_to_hsl.hh,
* mln/literal/grays.hh,
* mln/literal/identity.hh,
* mln/literal/max.hh,
* mln/literal/min.hh,
* mln/literal/one.hh,
* mln/literal/origin.hh,
* mln/literal/zero.hh: Add default constructors.
2011-11-21 Guillaume Lazzara <z@lrde.epita.fr>
 
Fix compilation issues with g++ 4.6.1 and clang++.
......@@ -83,6 +83,10 @@ namespace mln
struct snake_vert_t : public Browsing< snake_vert_t >
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
snake_vert_t();
template <typename F>
void operator()(F& f) const;
};
......@@ -93,6 +97,13 @@ namespace mln
const snake_vert_t snake_vert = snake_vert_t();
# endif // ! MLN_WO_GLOBAL_VARS
inline
snake_vert_t::snake_vert_t()
{
}
template <typename F>
inline
void
......
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -57,6 +58,8 @@ namespace mln
{
typedef T_rgb result;
f_hsi_to_rgb_();
template <typename T_hsi>
T_rgb operator()(const T_hsi& hsi) const;
......@@ -74,6 +77,14 @@ namespace mln
f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8;
/// \}
# endif // ! MLN_WO_GLOBAL_VARS
template <typename T_rgb>
f_hsi_to_rgb_<T_rgb>::f_hsi_to_rgb_()
{
}
template <typename T_rgb>
template <typename T_hsi>
inline
......
......@@ -49,6 +49,8 @@ namespace mln
{
typedef T_hsi result;
f_rgb_to_hsi_();
template <typename T_rgb>
T_hsi operator()(const T_rgb& rgb) const;
......@@ -67,6 +69,12 @@ namespace mln
/// \}
template <typename T_hsi>
f_rgb_to_hsi_<T_hsi>::f_rgb_to_hsi_()
{
}
template <typename T_hsi>
template <typename T_rgb>
inline
......
......@@ -58,6 +58,8 @@ namespace mln
{
typedef T_hsl result;
f_rgb_to_hsl_();
template <typename T_rgb>
T_hsl operator()(const T_rgb& rgb) const;
......@@ -76,6 +78,11 @@ namespace mln
/// \}
template <typename T_hsl>
f_rgb_to_hsl_f_t<T_hsl>::f_rgb_to_hsl_f_t()
{
}
template <typename T_hsl>
template <typename T_rgb>
inline
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -27,7 +28,7 @@
# define MLN_LITERAL_GRAYS_HH
/*! \file
* \brief Definition of the colors literal.
* \brief Definition of the grays literal.
*
*/
......@@ -42,32 +43,60 @@ namespace mln
/// Type of literal grays.
struct light_gray_t : public Literal<light_gray_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
light_gray_t();
};
struct medium_gray_t : public Literal<medium_gray_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
medium_gray_t();
};
struct dark_gray_t : public Literal<dark_gray_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
dark_gray_t();
};
/// Literal light gray.
extern const light_gray_t& light_gray;
extern const light_gray_t light_gray;
/// Literal medium_gray.
extern const medium_gray_t& medium_gray;
extern const medium_gray_t medium_gray;
/// Literal dark gray.
extern const dark_gray_t& dark_gray;
extern const dark_gray_t dark_gray;
# ifndef MLN_INCLUDE_ONLY
const light_gray_t& light_gray = light_gray_t();
# ifndef MLN_WO_GLOBAL_VARS
const medium_gray_t& medium_gray = medium_gray_t();
const light_gray_t light_gray;
const dark_gray_t& dark_gray = dark_gray_t();
const medium_gray_t medium_gray;
const dark_gray_t dark_gray;
# endif // ! MLN_WO_GLOBAL_VARS
inline
light_gray_t::light_gray_t()
{
}
inline
medium_gray_t::medium_gray_t()
{
}
inline
dark_gray_t::dark_gray_t()
{
}
# endif // !MLN_INCLUDE_ONLY
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -42,16 +43,24 @@ namespace mln
/// Type of literal identity.
struct identity_t : public Literal<identity_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
identity_t();
};
/// Literal identity.
extern const identity_t& identity;
extern const identity_t identity;
# ifndef MLN_INCLUDE_ONLY
inline
identity_t::identity_t()
{
}
# ifndef MLN_WO_GLOBAL_VARS
const identity_t& identity = identity_t();
const identity_t identity;
# endif // !MLN_WO_GLOBAL_VARS
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -43,6 +44,9 @@ namespace mln
/// Type of literal max.
struct max_t : public Literal<max_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
max_t();
template <typename T>
operator T () const;
......@@ -50,11 +54,16 @@ namespace mln
/// Literal max.
extern const max_t& max;
extern const max_t max;
# ifndef MLN_INCLUDE_ONLY
inline
max_t::max_t()
{
}
template <typename T>
inline
max_t::operator T () const
......
......@@ -43,6 +43,9 @@ namespace mln
/// Type of literal min.
struct min_t : public Literal<min_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
min_t();
template <typename T>
operator T () const;
......@@ -50,11 +53,16 @@ namespace mln
/// Literal min.
extern const min_t& min;
extern const min_t min;
# ifndef MLN_INCLUDE_ONLY
inline
min_t::min_t()
{
}
template <typename T>
inline
min_t::operator T () const
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -43,6 +44,10 @@ namespace mln
/// Type of literal one.
struct one_t : public Literal<one_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
one_t();
// FIXME: Cf. comments in literal/zero.hh.
template <typename T>
......@@ -51,11 +56,16 @@ namespace mln
/// Literal one.
extern const one_t& one;
extern const one_t one;
# ifndef MLN_INCLUDE_ONLY
inline
one_t::one_t()
{
}
template <typename T>
inline
one_t::operator const T () const
......@@ -66,7 +76,7 @@ namespace mln
# ifndef MLN_WO_GLOBAL_VARS
const one_t& one = one_t();
const one_t one;
# endif // !MLN_WO_GLOBAL_VARS
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -43,16 +44,24 @@ namespace mln
/// Type of literal origin.
struct origin_t : public Literal<origin_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
origin_t();
};
/// Literal origin.
extern const origin_t& origin;
extern const origin_t origin;
# ifndef MLN_INCLUDE_ONLY
inline
origin_t::origin_t()
{
}
# ifndef MLN_WO_GLOBAL_VARS
const origin_t& origin = origin_t();
const origin_t origin;
# endif // !MLN_WO_GLOBAL_VARS
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -45,6 +46,10 @@ namespace mln
/// Type of literal zero.
struct zero_t : public Literal<zero_t>
{
// This default constructor is needed for compilation with gcc
// 4.6.0, gcc 4.6.1 and Clang.
zero_t();
// FIXME: (for the record) Add "friend class Literal<zero_t>;" and a protected ctor.
template <typename T>
......@@ -52,10 +57,15 @@ namespace mln
};
/// Literal zero.
extern const zero_t& zero;
extern const zero_t zero;
# ifndef MLN_INCLUDE_ONLY
inline
zero_t::zero_t()
{
}
template <typename T>
inline
zero_t::operator const T () const
......@@ -66,9 +76,9 @@ namespace mln
# ifndef MLN_WO_GLOBAL_VARS
const zero_t& zero = zero_t();
const zero_t zero;
# endif // !MLN_GLOBAL_VARS
# endif // !MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
......
Supports Markdown
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