devxlogo

The standard functions isalpha(), isdigit(), isprint() etc., defined in the stan

The .* and ->* operators enable you to call a member function without having to know the function’s name. Remember, however, that when using these operators, you have to parenthesize the expression as follows:

 A a; // create objectvoid (A::*pmf)() = &A::f; // create pointer to member// the two pairs of parentheses are needed here:(a.*pmf)(); // call A::f() thorough pointer to member

Omitting the first pair of parentheses, as in the following example, is a common mistake:

 a.*pmf(); // error, missing parentheses

Although some compilers might accept it, this is not the correct C++ syntax. Always use two pairs of parentheses when calling a member function through either .* or ->*.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.