No longer forward declare struct std:hash

This commit is contained in:
Andreas Fabri 2015-08-23 14:30:54 +02:00
parent eb22148902
commit bf975ead95
5 changed files with 33 additions and 25 deletions

View File

@ -564,8 +564,7 @@ namespace std {
# pragma warning(disable:4099) // For VC10 it is class hash # pragma warning(disable:4099) // For VC10 it is class hash
#endif #endif
template < class T> #ifndef CGAL_CFG_NO_STD_HASH
struct hash;
template <class CIterator_, class Filter_, class MIterator_, template <class CIterator_, class Filter_, class MIterator_,
class Value_, class Diff_, class Category_> class Value_, class Diff_, class Category_>
@ -607,7 +606,15 @@ struct hash<CGAL::I_Filtered_const_iterator<CIterator_,
return reinterpret_cast<std::size_t>(&*i) / sizeof(typename I::value_type); return reinterpret_cast<std::size_t>(&*i) / sizeof(typename I::value_type);
} }
}; };
}
#endif // CGAL_CFG_NO_STD_HASH
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
} // namespace std
namespace boost { namespace boost {
template <typename T> struct hash; template <typename T> struct hash;
@ -652,9 +659,5 @@ struct hash<CGAL::I_Filtered_const_iterator<CIterator_,
} }
}; };
#if defined(BOOST_MSVC) } // namespace boost
# pragma warning(pop)
#endif
}
#endif #endif

View File

@ -188,6 +188,10 @@
#define CGAL_CXX11 #define CGAL_CXX11
#endif #endif
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) || BOOST_VERSION < 105000
#define CGAL_CFG_NO_STD_HASH 1
#endif
//----------------------------------------------------------------------// //----------------------------------------------------------------------//
// auto-link the CGAL library on platforms that support it // auto-link the CGAL library on platforms that support it
//----------------------------------------------------------------------// //----------------------------------------------------------------------//

View File

@ -1176,9 +1176,8 @@ namespace std {
# pragma warning(push) # pragma warning(push)
# pragma warning(disable:4099) // For VC10 it is class hash # pragma warning(disable:4099) // For VC10 it is class hash
#endif #endif
template < class T> #ifndef CGAL_CFG_NO_STD_HASH
struct hash;
template < class DSC, bool Const > template < class DSC, bool Const >
struct hash<CGAL::internal::CC_iterator<DSC, Const> > struct hash<CGAL::internal::CC_iterator<DSC, Const> >
@ -1189,10 +1188,12 @@ namespace std {
return reinterpret_cast<std::size_t>(&*i) / sizeof(typename DSC::value_type); return reinterpret_cast<std::size_t>(&*i) / sizeof(typename DSC::value_type);
} }
}; };
#endif // CGAL_CFG_NO_STD_HASH
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
# pragma warning(pop) # pragma warning(pop)
#endif #endif
} } // namespace boost
#endif // CGAL_COMPACT_CONTAINER_H #endif // CGAL_COMPACT_CONTAINER_H

View File

@ -778,8 +778,7 @@ namespace std {
# pragma warning(disable:4099) // For VC10 it is class hash # pragma warning(disable:4099) // For VC10 it is class hash
#endif #endif
template < class T> #ifndef CGAL_CFG_NO_STD_HASH
struct hash;
template < class T, class Alloc > template < class T, class Alloc >
struct hash<CGAL::internal::In_place_list_iterator<T, Alloc> > struct hash<CGAL::internal::In_place_list_iterator<T, Alloc> >
@ -802,10 +801,12 @@ namespace std {
return reinterpret_cast<std::size_t>(ptr)/ sizeof(T); return reinterpret_cast<std::size_t>(ptr)/ sizeof(T);
} }
}; };
#endif // CGAL_CFG_NO_STD_HASH
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
# pragma warning(pop) # pragma warning(pop)
#endif #endif
} } // namespace std
#endif // CGAL_IN_PLACE_LIST_H #endif // CGAL_IN_PLACE_LIST_H

View File

@ -3133,10 +3133,7 @@ namespace std {
# pragma warning(disable:4099) // For VC10 it is class hash # pragma warning(disable:4099) // For VC10 it is class hash
#endif #endif
#ifndef DOXYGEN_RUNNING #ifndef CGAL_CFG_NO_STD_HASH
template < class T>
struct hash;
#endif
template <> template <>
struct hash<CGAL::SM_Halfedge_index > struct hash<CGAL::SM_Halfedge_index >
@ -3177,7 +3174,13 @@ namespace std {
return i; return i;
} }
}; };
} #endif // CGAL_CFG_NO_STD_HASH
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
} // namespace std
namespace boost { namespace boost {
template <> template <>
@ -3188,11 +3191,7 @@ namespace boost {
} }
}; };
#if defined(BOOST_MSVC) } // namespace boost
# pragma warning(pop)
#endif
}
#endif /* CGAL_SURFACE_MESH_H */ #endif /* CGAL_SURFACE_MESH_H */