Click here to Skip to main content
15,903,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker error when adding Ole to my application, what am I missing? Pin
charlieg6-Jan-23 5:07
charlieg6-Jan-23 5:07 
QuestionRe: Linker error when adding Ole to my application, what am I missing? Pin
Randor 5-Jan-23 16:41
professional Randor 5-Jan-23 16:41 
AnswerRe: Linker error when adding Ole to my application, what am I missing? Pin
charlieg6-Jan-23 10:17
charlieg6-Jan-23 10:17 
GeneralRe: Linker error when adding Ole to my application, what am I missing? Pin
Randor 6-Jan-23 10:40
professional Randor 6-Jan-23 10:40 
Questionhow to interact with access control and open the door from My c++ desktop application Pin
Zouaoui Billel31-Dec-22 4:58
Zouaoui Billel31-Dec-22 4:58 
AnswerRe: how to interact with access control and open the door from My c++ desktop application Pin
Richard MacCutchan31-Dec-22 5:11
mveRichard MacCutchan31-Dec-22 5:11 
QuestionMessage Closed Pin
27-Dec-22 9:31
Member 1496877127-Dec-22 9:31 
AnswerRe: How to link C code to which Bluetooth library ? ( Linux) Pin
k505427-Dec-22 10:30
mvek505427-Dec-22 10:30 
AnswerRe: How to link C code to which Bluetooth library ? ( Linux) Pin
Richard MacCutchan27-Dec-22 22:03
mveRichard MacCutchan27-Dec-22 22:03 
QuestionInsert a Container App Pin
Glenn Meadows 202227-Dec-22 5:07
Glenn Meadows 202227-Dec-22 5:07 
AnswerRe: Insert a Container App Pin
Richard MacCutchan27-Dec-22 22:06
mveRichard MacCutchan27-Dec-22 22:06 
SuggestionRe: Insert a Container App Pin
David Crow28-Dec-22 4:49
David Crow28-Dec-22 4:49 
QuestionHaving trouble with a function in C Pin
BuilderboiYT26-Dec-22 15:38
BuilderboiYT26-Dec-22 15:38 
AnswerRe: Having trouble with a function in C Pin
Victor Nijegorodov26-Dec-22 20:12
Victor Nijegorodov26-Dec-22 20:12 
AnswerRe: Having trouble with a function in C Pin
Richard MacCutchan26-Dec-22 22:10
mveRichard MacCutchan26-Dec-22 22:10 
AnswerRe: Having trouble with a function in C Pin
Mircea Neacsu26-Dec-22 22:34
Mircea Neacsu26-Dec-22 22:34 
GeneralRe: Having trouble with a function in C Pin
Richard MacCutchan26-Dec-22 23:39
mveRichard MacCutchan26-Dec-22 23:39 
QuestionInvalid comparator for STL map Pin
ForNow25-Dec-22 18:08
ForNow25-Dec-22 18:08 
AnswerRe: Invalid comparator for STL map Pin
Daniel Pfeffer25-Dec-22 19:36
professionalDaniel Pfeffer25-Dec-22 19:36 
GeneralRe: Invalid comparator for STL map Pin
ForNow25-Dec-22 21:33
ForNow25-Dec-22 21:33 
GeneralRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 5:14
ForNow26-Dec-22 5:14 
this is were I am getting the exception at the line with STL_VERIFY

C++
// FUNCTION TEMPLATE _Debug_lt_pred
template <class _Pr, class _Ty1, class _Ty2,
    enable_if_t<is_same_v<_Remove_cvref_t<_Ty1>, _Remove_cvref_t<_Ty2>>, int> = 0>
constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) noexcept(
    noexcept(_Pred(_Left, _Right)) && noexcept(_Pred(_Right, _Left))) {
    // test if _Pred(_Left, _Right) and _Pred is strict weak ordering, when the arguments are the cv-same-type
    const auto _Result = static_cast<bool>(_Pred(_Left, _Right));
    if (_Result) {
        _STL_VERIFY(!_Pred(_Right, _Left), "invalid comparator");


this is my code
C++
struct usingrange
{
	ESDID esdid;
	int start;
	int end;
	
	usingrange() { start = 0; end = 0; return; }
  bool operator<(const usingrange& x) const {
	  if (esdid < x.esdid)
		  return esdid < x.esdid;
	  if (start < x.start) 
		  return start < x.start;
	  if (end < x.end) return end < x.end;
	  else
		  return x.end < end;


when I change mt code to
C++
bool operator<(const usingrange& x) const {

    return start < x.start;
 }


everything works I dont get it the operator is excepting a bool retrun code true or false in either I retrun that
GeneralRe: Invalid comparator for STL map Pin
Graham Breach26-Dec-22 6:15
Graham Breach26-Dec-22 6:15 
JokeRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 6:51
ForNow26-Dec-22 6:51 
GeneralRe: Invalid comparator for STL map Pin
ForNow26-Dec-22 7:39
ForNow26-Dec-22 7:39 
GeneralRe: Invalid comparator for STL map solution Pin
ForNow26-Dec-22 8:31
ForNow26-Dec-22 8:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.