devxlogo

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

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 ->*.

See also  How to Block Websites During Certain Hours on a Mac Computer
devxblackblue

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.

About Our Journalist