Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.

Public Report
Report From: C++BuilderX/Compiler    [ Add a report in this area ]  
Report #:  8234   Status: Reported
lower_bound fails even when less is defined
Project:  C++BuilderX/BC++ 2005 Build #:  1.0.0.1786
Version:    1.0 Submitted By:   Tron Thomas
Report Type:  Basic functionality failure Date Reported:  5/21/2004 11:08:16 AM
Severity:    Commonly encountered problem Last Updated: 5/21/2004 11:03:36 AM
Platform:    All versions Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The lower_bound algorithm from the stl fails to successfully compile when a proper less operator is defined to compare against the lower bound value to search for
Steps to Reproduce:
Use bcc32 -v -WC -w -x -xd -A -AT -RT to compile the attached file.

Results:

Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland
floatvalue.cpp:
Error E2034 E:\CBuilderX\include\stl/_algobase.c 371: Cannot convert 'FloatValue' to 'float' in function _STL::FloatValue * __lower_bound<FloatValue *
,float,less<float>,int>(FloatValue *,FloatValue *,const float &,less<float>,int *)
Error E2342 E:\CBuilderX\include\stl/_algobase.c 371: Type mismatch in parameter '__x' (wanted 'const float &', got 'FloatValue') in function _STL::Fl
oatValue * __lower_bound<FloatValue *,float,less<float>,int>(FloatValue *,FloatValue *,const float &,less<float>,int *)
*** 2 errors in Compile ***

Expected:
The code compiles successfully on both the GNU and Microsoft compilers.  It should compile with the Borland compiler as well.
Workarounds
None
Attachment
FloatValue.zip
Comments

Robert Ehteshamzadeh at 8/3/2004 2:49:00 PM -
Unfortunately we don't organize QC into

Borland Toolchain
              Compiler
              Linker
              RTL.

While this is a problem with the toolchain, it isn't necessarily a bug in the compiler.


Tron Thomas at 12/5/2006 10:45:08 AM -
This code no longer produces a error when compiling for C++ Builder 10.0.2288.42451

Server Response from: ETNACODE01