Question: 7. (Pointers and Non-pointers) This exercise consists of calling some functions from the Primary type category. Answer the following questions: a) Write a function to

7. (Pointers and Non-pointers)

This exercise consists of calling some functions from the Primary type category.

Answer the following questions:

a) Write a function to determine if a type is a pointer, null pointer, lvalue reference or rvalue reference.

b) Determine if a type is a member function pointer or if it is a pointer to a non-static member object.

c) Is a shared pointer a pointer type? Is it a pointer type when converted to a raw pointer?

Typical code is:

template

void IsPointer(const T& t)

{ // First example of type_traits;check if t is a pointer

// Return type is std::true_type or std::false_type if (std::is_pointer::value)
{
std::cout << "This is a pointer type argument";
}
else {
std::cout << "_not_ a pointer type argument";
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting For Financial Instruments Questions!