Use of old-style cast

Typically: "How do I... ", "How can I... " questions
Post Reply
neshom
Posts: 71
Joined: 21 Jul 2015, 20:55

Use of old-style cast

Post by neshom »

I am using V-REP C++ API in Qt. I call V-REP functions like this:

Code: Select all

simxSetFloatingParameter(vrepClientID, sim_floatparam_simulation_time_step, (simxFloat)0.05, simx_opmode_blocking);
It works, but I get the following warning because of (simxFloat)0.05:

Code: Select all

Semantic Issue:
warning: use of old-style cas
I can solve it by using the function like this:

Code: Select all

simxSetFloatingParameter(vrepClientID, sim_floatparam_simulation_time_step, static_cast<float>(0.05), simx_opmode_blocking);
Is this correct? Is there any shorter version?

fferri
Posts: 1229
Joined: 09 Sep 2013, 19:28

Re: Use of old-style cast

Post by fferri »

That is correct. In C++ there are only the xxx_cast<...>(...) operators.

Post Reply