-
December 28th, 2020, 02:52 PM
#1
i have 2 "errors term does not evaluate to a function tacking 2 arguments" in line 64
Code:
#include "Bibleoteca.h"
#include<list>
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
void Bibleoteca::Adauga(Carte book)
{
books.push_back(book);
cout << endl;
}
void Bibleoteca::Afis()
{
for (auto& elem : books)
{
elem.Print();
}
}
void Bibleoteca::cauta_Titlu(string title)
{
for (auto &elem : books)
{
if (elem.titlu == title)
{
elem.Print();
}
}
}
//void Bibleoteca::caut_Editura(string editura)
//{
// auto reult = find(begin(books), end(books), editura);
// if (reult != end(books))
// {
// this->Afis();
// }
// else
// {
// cout << "librarie nu contine" << endl;
// }
//}
Carte * Bibleoteca::caut_ISBN(string ISBN)
{
for (auto &elem : books)
{
if (elem.ISBN == ISBN)
{
return &elem;
}
}
return nullptr;
}
void Bibleoteca::unic_ISBN(string ISBN)
{
auto count = unique(books.begin(), books.end(),books.size());
}
Last edited by VictorN; December 29th, 2020 at 04:29 AM.
Reason: added CODE tags
-
December 29th, 2020, 04:31 AM
#2
Re: i have 2 "errors term does not evaluate to a function tacking 2 arguments" in lin
1. Please use COODE tags while posting code snippets.
2. Where is your "line 64"?
Victor Nijegorodov
-
December 29th, 2020, 04:34 AM
#3
Re: i have 2 "errors term does not evaluate to a function tacking 2 arguments" in lin
Code:
auto count = unique(books.begin(), books.end(),books.size());
If this is using std::unique()? If yes, then its 3rd param is wrong. Either don't have one or it needs to be binary predicate.
See auto count = unique(books.begin(), books.end(),books.size());
If this is not std::unique(), what's the implementation/declaration?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|