From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1766 invoked by alias); 16 May 2007 12:55:30 -0000 Received: (qmail 1731 invoked by uid 48); 16 May 2007 12:55:15 -0000 Date: Wed, 16 May 2007 12:55:00 -0000 Subject: [Bug c++/31951] New: local structure problem X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ndbecker2 at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg01193.txt.bz2 2nd call to partial_sort gives 'no match...' error, but 1st is OK. Doesn't seem right. #include #include template struct Sort_Func2 { vector_t const& mag; Sort_Func2 (vector_t const& _mag) : mag (_mag) {} bool operator() (int a, int b) const { return mag [a] < mag [b]; } }; template void F (vector_t const& v) { struct Sort_Func { vector_t const& mag; Sort_Func (vector_t const& _mag) : mag (_mag) {} bool operator() (int a, int b) const { return mag [a] < mag [b]; } }; std::vector indexes (v.size()); std::partial_sort (indexes.begin(), indexes.begin()+2, indexes.end(), Sort_Func2 (v)); std::partial_sort (indexes.begin(), indexes.begin()+2, indexes.end(), Sort_Func (v)); } int main() { std::vector v; F (v); } -- Summary: local structure problem Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ndbecker2 at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31951