user3836675
user3836675

Reputation: 1

Initializing auto variables in VC++ 2012

I am new to VC++ 2012. I have this code snippet.

auto it = query_map.find(U("callback"));

The problem is right under the dot there is a red line the error is

Error 1 error C2664: 'std::_Tree_iterator std::_Tree::find(const http::uri::encoded_string &)' : cannot convert parameter 1 from 'const wchar_t [9]' to 'const http::uri::encoded_string &' d:\maverick\projects\strikeforce\src\server\server\server.cpp 26 

Can someone tell me a solution to this error?

Upvotes: 0

Views: 62

Answers (1)

Antwane
Antwane

Reputation: 22658

Error 1 error C2664: 'std::_Tree_iterator std::_Tree::find(const http::uri::encoded_string &)'

This is a problem with the method find() from the class std::Tree

cannot convert parameter 1 from 'const wchar_t [9]' to 'const http::uri::encoded_string &'

The find() method must be used with a paremeter of type 'const http::uri::encoded_string &', but you passed a 'const wchar_t [9]'.

the method U() you have used returns an array of chars, but the find() method need another type of object.

Upvotes: 2

Related Questions