std::basic_string::copy deprecated?

J

Jonathan Mcdougall

Visual studio 2005 reports

main.cpp(8) : warning C4996:
'std::basic_string<_Elem,_Traits,_Ax>::copy' was declared deprecated

with this program:

# include <string>

int main()
{
std::string s("Testing");
char buffer[10];

s.copy(buffer, 10); // < here
}

Comeau compiles this fine. I just wanted to know if the message meant
"was declared deprecated by Microsoft" or "was declared deprecated in
the standard". Could not find anything in the draft of tr1.


Thanks,


Jonathan
 
J

Jonathan Mcdougall

Jonathan said:
Visual studio 2005 reports

main.cpp(8) : warning C4996:
'std::basic_string<_Elem,_Traits,_Ax>::copy' was declared deprecated

with this program:

# include <string>

int main()
{
std::string s("Testing");
char buffer[10];

s.copy(buffer, 10); // < here
}

Comeau compiles this fine. I just wanted to know if the message meant
"was declared deprecated by Microsoft" or "was declared deprecated in
the standard". Could not find anything in the draft of tr1.

Ok, ok, I get it. From Boost.org:

"Boost does not support the non-standard "Safe" C++ Library shipping
with Visual C++ 8.0, which may result in many spurious warnings from
Boost headers and other standards-conforming C++ code"


Jonathan
 
J

Josh Mcfarlane

Jonathan said:
Ok, ok, I get it. From Boost.org:

"Boost does not support the non-standard "Safe" C++ Library shipping
with Visual C++ 8.0, which may result in many spurious warnings from
Boost headers and other standards-conforming C++ code"


Jonathan

Basically, Microsoft added _s versions to most buffer commands, causing
either an implicit or explicit size definition in an effort to reduce
errors on their OS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top