How to detect if variable is float in C++

Is there any way of detecting if variable is a float in an if statement. For example:

float x = 32

if (x == float) {cout << "true"}

else {cout << "false"}

Output: false

float x = 68.7

if (x == float) {cout << "true"}

else {cout << "false"}

Output: true