Jump to content
  • Advertisement
Sign in to follow this  
FGFS

arguments

This topic is 1817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi

what arguments does it want?

 

    - invalid use of ‘std::vector<Procedure*>::value_type’
    - Invalid arguments ' Candidates are: unsigned long int count(const std::basic_string<char,std::char_traits<char>,std::allocator<char>>

 

What are char_traits, allocator etc.

Thanks

 

 

Share this post


Link to post
Share on other sites
Advertisement

it's huge...

and what is the "?"

IFSDatabase::getAppr(&it);

 

nvalid arguments ' Candidates are: std::vector<Procedure *,std::allocator<Procedure *>> getAppr(const ? &) '

 

the declaration is:

 

    virtual ProcedureList getAppr(const QString &id);

 

and the class:

 

class Procedure : public Route
{
public:

    Procedure();

    Procedure(const QString& id,
              const QStringList& runway_list);

    virtual ~Procedure() {};

    virtual const Procedure* asProcedure() const { return this; }
    virtual Procedure* asProcedure() { return this; }

    virtual QString toString() const;

    /////////////////////////////////////////////////////////////////////////////

    const QStringList& runwayList() const {  return m_runway_list; }
    void setRunwayList(const QStringList& runway_list) { m_runway_list = runway_list; }

protected:

    QStringList m_runway_list;
};

/////////////////////////////////////////////////////////////////////////////

typedef vector<Procedure*> ProcedureList;
typedef PtrList<Procedure> ProcedurePtrList;
typedef QListIterator<Procedure*> ProcedurePtrListIterator;

 

 

and

 

class IFSDatabase
{
public:

    IFSDatabase();
    virtual ~IFSDatabase() {};
    virtual void load();
...
    virtual ProcedureList getAppr(const QString &id);

...

Edited by FGFS

Share this post


Link to post
Share on other sites

   for (std::multimap<string, ProcedureList>::iterator it=m_procedure_map.begin(); it!=m_procedure_map.end(); ++it)
   {
       const char* msga = IFSDatabase::getAppr(&it);

Share this post


Link to post
Share on other sites
You have got all the types wrong. You have declared getAppr to take a QString as argument but you try to pass it a pointer to an iterator, and then you try to store the return value as a char pointer when the function actually returns a vector.

I don't see how you expected this to work. Did you maybe call the wrong function?

Share this post


Link to post
Share on other sites

Yes, so how to pass a QString and store the return value? Basically I want first to see the value, hence I tried char*.

Thanks

Share this post


Link to post
Share on other sites
So I guess you want to pass the map key to the function. I have never used Qt but from the documentation it seems that std::string will not be converted to a QString implicitly so you probably have to use the fromStdString function.

The value type of the map is the same as the return type of the function so I guess you want to assign the returned value to that vector in the map.

.. so I guess it would look something like this:
it->second = IFSDatabase::getAppr(QString::fromStdString(it->first));

Share this post


Link to post
Share on other sites

Thanks

  with:

const char* msga = IFSDatabase::getAppr(QString::fromStdString(it->first));

I get:

    - cannot convert ‘ProcedureList {aka std::vector<Procedure*>}’ to ‘const char*’ in initialization

 

sure but how to view the values. Also with std::cout << I get errors.

 

but with second:

 

       IFSDatabase::getAppr(QString::fromStdString(it->second));

 

i get:

Multiple markers at this line
    - Function 'fromStdString' could not be resolved
    - Invalid arguments ' Candidates are: std::vector<Procedure *,std::allocator<Procedure *>> getAppr(const ?
     &) '
    - no matching function for call to ‘QString::fromStdString(std::vector<Procedure*>&)’
    - candidate is:

Edited by FGFS

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!