Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return type vector<string> throwing heaps of warnings 1

Status
Not open for further replies.

Flappy

Programmer
Jul 30, 2002
35
AU
Hi me again,

ne1 know why this would be throwing alot of warnings?

class blaba {
vector<string> dosomething(... , ..);
};

vector<string> dosomething(... , ..) {
...
};

it only seems to throw warnings when trying to use a return type of vector<string> - any other type of vector its fine..? the program still compiles and runs fine but the warnings r annoying
 
Hi again Flappy, it's to do with the length of the identifiers. It's a not a big deal but like you say those warnings can be annoying.

You can disable those particular kind of warning messages by using a #pragma warning message:[tt]

#pragma warning( disable : 4786 )[/tt]

Just add the above line of code somewhere at the head of the offending code.

:)


tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
It's not the length of the identifiers, but of the type name. When you say vector<string>, it's really short for ::std::vector<::std::basic_string<char,::std::char_traits<char>,::std::allocator<char> >,::std::allocator<::std::basic_string<char,::std::char_traits<char>,::std::allocator<char> > >. If you were the compiler, you'd complain, too.
 
Yeah, it's coz it's larger than 255 characters!! [bugeyed]
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top