CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2020
    Posts
    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

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,104

    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

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,554

    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++20 Compiler: Microsoft VS2019 (16.11.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
  •  





Click Here to Expand Forum to Full Width

Featured