gcc-4.3 c++ question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On upgrading from gcc-4.1.2 to gcc-4.3, this (stripped down) code is now
rejected:

#include <vector>
#include <iostream>

template<typename T, template <typename A> class CONT=std::vector>
class Ring {

};


template<typename Cont>
inline std::ostream& operator<<(std::ostream& os, const Ring<Cont>& r) {
  os << '[';
  os << ']';
  return os;
}
g++ -c test1.cc
test1.cc:11: error: type/value mismatch at argument 2 in template parameter
list for  template<class T, template<class A> class CONT> class Ring 
test1.cc:11: error:   expected a template of type  template<class A> class
CONT , got  template<class _Tp, class _Alloc> class std::vector 

What is a reasonable way to fix this?  The problem is that the 2nd parameter
says 

template<typename A> class CONT, which doesn't match std::vector because it
has an _optional_ 2nd parameter (class _Alloc).

I don't want to only match class CONT with those having a 2nd parameter
(class _Alloc) - that is too restrictive.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux