This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15469] Unable to compile valid code including transform() algorithm: <unknown type> is reported for the forth parameter


------- Additional Comments From relf at os2 dot ru  2004-05-17 04:26 -------
Wolfgang, could you please explain the difference with the following example
from B.Stroustrup "The C++ Programming Language" 3rd edition, section 18.6.2:

template<class T> T* delete_ptr(T* p) { delete p; return 0; }
void purge(deque<Shape*>& s)
{
    transform(s.begin(),s.end(),s.begin(),delete_ptr);
    // ...
}

Note that here we pass just `delete_ptr' but not `delete_ptr<Shape>' as the
forth parameter. Why this code does not reqire explicit template class
specification while my code (that is not much different, in fact) does?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15469


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]