No matching function transform?

Source: Internet
Author: User

http://stackoverflow.com/questions/19876746/stdtolower-and-visual-studio-2013

Http://forums.codeguru.com/showthread.php?489969-no-matching-function-transform

std::toloweris overloaded in C + +, it ' s declared in as <cctype>

int tolower(int);

And also in as <locale>

template<CharT> CharT tolower(CharT, const locale&);

So when you say " std::tolower " you get a ambiguous(blurry) reference to an overloaded function.

  1. Why ::tolower version is working?

When you include the <cctype> one-argument overload are declared in namespace std and mightalso are declared in the Global namespace, depending on the compiler. If you include then <ctype.h> it's guaranteed to being included in the global namespace, and would work ::tolower (although note Dietm Ar ' s points about when it's not safe. The two-argument overload from <locale> are never declared in the global namespace, so ::tolower never refers to the two-argument Overload.

2. Why isn't std::tolower working in Std::transform?

See above, it's an overloaded name.

No matching function transform?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.