By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,431 Members | 1,739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,431 IT Pros & Developers. It's quick & easy.

std::basic_string::copy deprecated?

P: n/a
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

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jonathan Mcdougall wrote:
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

Nov 22 '05 #2

P: n/a

Jonathan Mcdougall wrote:
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

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.