It is a very simple statement, nevertheless it makes me confused:
pcl::OpenNIGrabber grabber (device_id, depth_mode, image_mode);
Is it a function declaration? In case, why parameters have no type
declared? Is it a function call?
Any clue?
It's a declaration of a variable (if device_id etc. are values) or a
function (if device_id etc. are types).
Assuming that it's a variable declaration:
The type of the variable is pcl::OpenNIGrabber.
The name is grabber.
The constructor arguments are device_id, depth_mode and image_mode.
Further assuming that this declaration compiles this means that the
pcl::OpenNIGrabber type is a class type that has at least one
constructor that takes 3 arguments, where the formal argument types can
accept the given arguments.
When the execution passes through the declaration the pcl::OpenNIGrabber
constructor is called with the given arguments, so the declaration
involves -- but isn't itself -- also a function call (a constructor is a
special function, and it's called here).
As a result of the constructor call an exception may be thrown here,
namely if the constructor fails.
Cheers & hth.,
- Alf