eina-cxx: fix compilation error on clang

Summary:
Fixed compilation error on clang when std::vector<char>::iterator and
std::string::iterator are the same type in type_traits for contiguous
traits optimization.

@fix

Reviewers: MagikBSD, tasn, cedric, raster, savio, woohyun

Reviewed By: tasn

CC: cedric

Maniphest Tasks: T1328

Differential Revision: https://phab.enlightenment.org/D1004

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
Felipe Magno de Almeida 2014-06-12 17:34:19 +02:00 committed by Cedric BAIL
parent 9a4deeafe2
commit f5c4481be8
1 changed files with 11 additions and 5 deletions

View File

@ -30,16 +30,22 @@ using std::false_type;
using std::remove_pointer;
using std::remove_reference;
template <typename T>
struct indirect_is_contiguous_iterator : false_type
{};
template <>
struct indirect_is_contiguous_iterator<std::vector<char>::iterator> : std::true_type
{};
template <>
struct indirect_is_contiguous_iterator<std::vector<char>::const_iterator> : std::true_type
{};
template <typename T, typename Enable = void>
struct is_contiguous_iterator : false_type {};
struct is_contiguous_iterator : indirect_is_contiguous_iterator<T> {};
template <>
struct is_contiguous_iterator<std::string::const_iterator> : true_type {};
template <>
struct is_contiguous_iterator<std::string::iterator> : true_type {};
template <>
struct is_contiguous_iterator<std::vector<char>::const_iterator> : true_type {};
template <>
struct is_contiguous_iterator<std::vector<char>::iterator> : true_type {};
template <bool, typename T, typename F>
struct if_c