From 2bf3081baae5d7bfc8aae144ff6e433fdf28ea0b Mon Sep 17 00:00:00 2001 From: Adam Wardynski <award@.(B-4.4.46a)> Date: Thu, 28 Apr 2011 22:13:48 +0200 Subject: [PATCH] Fix gcc compile errors around templated type definitions. --- libwccl/ops/opsequence.h | 4 ++-- libwccl/wcclfile.h | 12 ++++++------ libwccl/wcclfileopsections.h | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libwccl/ops/opsequence.h b/libwccl/ops/opsequence.h index cfa3b57..54eb9e7 100644 --- a/libwccl/ops/opsequence.h +++ b/libwccl/ops/opsequence.h @@ -182,7 +182,7 @@ class OpSequence : public FunctionalOpSequence BOOST_MPL_ASSERT( (boost::is_base_of<Value, T>) ); BOOST_MPL_ASSERT_NOT( (boost::is_same<Value, T>) ); public: - typedef typename Operator<T> op_t; + typedef Operator<T> op_t; typedef typename boost::shared_ptr<Operator<T> > op_ptr_t; typedef typename boost::shared_ptr<const Operator<T> > op_ptr_c_t; typedef typename std::pair<std::string, op_ptr_t> name_op_pair_t; @@ -331,7 +331,7 @@ OpSequence<T>::OpSequence(const OpSequence<T>& seq) } template<class T> inline -typename OpSequence<T>* OpSequence<T>::clone_internal() const +OpSequence<T>* OpSequence<T>::clone_internal() const { return new OpSequence(*this); } diff --git a/libwccl/wcclfile.h b/libwccl/wcclfile.h index 2897b4a..1e8f685 100644 --- a/libwccl/wcclfile.h +++ b/libwccl/wcclfile.h @@ -25,7 +25,7 @@ public: const std::vector<boost::shared_ptr<UntypedOpSequence> >& untyped_sections(); template<class T> - typename const std::vector<boost::shared_ptr<OpSequence<T> > >& sections(); + const typename std::vector<boost::shared_ptr<OpSequence<T> > >& sections(); bool has_untyped_section(const std::string& name) const; template<class T> @@ -122,7 +122,7 @@ const std::vector<boost::shared_ptr<UntypedOpSequence> >& WcclFile::untyped_sect } template<class T> inline -typename const std::vector<boost::shared_ptr<OpSequence<T> > >& WcclFile::sections() +const typename std::vector<boost::shared_ptr<OpSequence<T> > >& WcclFile::sections() { return WcclFileOpSections<OpSequence<T> >::sections(); } @@ -164,13 +164,13 @@ const UntypedOpSequence& WcclFile::get_untyped_section(const std::string& name) } template<class T> inline -typename OpSequence<T>& WcclFile::get_section(const std::string& name) +OpSequence<T>& WcclFile::get_section(const std::string& name) { return WcclFileOpSections<OpSequence<T> >::get_section(name); } template<class T> inline -typename const OpSequence<T>& WcclFile::get_section(const std::string& name) const +const OpSequence<T>& WcclFile::get_section(const std::string& name) const { return WcclFileOpSections<OpSequence<T> >::get_section(name); } @@ -211,13 +211,13 @@ const FunctionalOperator& WcclFile::get_untyped_op(const std::string& name, size } template<class T> inline -typename Operator<T>& WcclFile::get_op(const std::string& name, size_t idx) +Operator<T>& WcclFile::get_op(const std::string& name, size_t idx) { return WcclFileOpSections<Operator<T> >::get_op(name, idx); } template<class T> inline -typename const Operator<T>& WcclFile::get_op(const std::string& name, size_t idx) const +const Operator<T>& WcclFile::get_op(const std::string& name, size_t idx) const { return WcclFileOpSections<Operator<T> >::get_op(name, idx); } diff --git a/libwccl/wcclfileopsections.h b/libwccl/wcclfileopsections.h index 409efca..49e7ae7 100644 --- a/libwccl/wcclfileopsections.h +++ b/libwccl/wcclfileopsections.h @@ -79,7 +79,7 @@ bool WcclFileOpSections<T>::has_section(const std::string& name) const } template<class T> inline -typename const WcclFileOpSections<T>::ptr_v_t& WcclFileOpSections<T>::sections() +const typename WcclFileOpSections<T>::ptr_v_t& WcclFileOpSections<T>::sections() { return sections_; } @@ -109,7 +109,7 @@ std::vector<std::string> WcclFileOpSections<T>::section_names() const template<class T> inline typename WcclFileOpSections<T>::ptr_t WcclFileOpSections<T>::get_section_ptr(const std::string& name) { - map_t::iterator i = name_section_map_.find(name); + typename map_t::iterator i = name_section_map_.find(name); if (i == name_section_map_.end()) { throw InvalidArgument("name", "Section named \"" + name + "\" does not exist."); } @@ -119,7 +119,7 @@ typename WcclFileOpSections<T>::ptr_t WcclFileOpSections<T>::get_section_ptr(con template<class T> inline typename WcclFileOpSections<T>::ptr_c_t WcclFileOpSections<T>::get_section_ptr(const std::string& name) const { - map_t::const_iterator i = name_section_map_.find(name); + typename map_t::const_iterator i = name_section_map_.find(name); if (i == name_section_map_.end()) { throw InvalidArgument("name", "Section named \"" + name + "\" does not exist."); } @@ -189,15 +189,15 @@ void WcclFileOpSections<T>::append(const ptr_t& section) template<class T> inline typename T::op_t& WcclFileOpSections<T>::get_op( const std::string& name, - size_t idx = 0) + size_t idx) { return get_section(name).get(idx); } template<class T> inline -typename const T::op_t& WcclFileOpSections<T>::get_op( +const typename T::op_t& WcclFileOpSections<T>::get_op( const std::string& name, - size_t idx = 0) const + size_t idx) const { return get_section(name).get(idx); } @@ -205,7 +205,7 @@ typename const T::op_t& WcclFileOpSections<T>::get_op( template<class T> inline typename WcclFileOpSections<T>::op_ptr_t WcclFileOpSections<T>::get_op_ptr( const std::string& name, - size_t idx = 0) + size_t idx) { return get_section(name).get_ptr(idx); } @@ -213,7 +213,7 @@ typename WcclFileOpSections<T>::op_ptr_t WcclFileOpSections<T>::get_op_ptr( template<class T> inline typename WcclFileOpSections<T>::op_ptr_c_t WcclFileOpSections<T>::get_op_ptr( const std::string& name, - size_t idx = 0) const + size_t idx) const { return get_section(name).get_ptr(idx); } -- GitLab