Can you explain what you want to do.
I don't think there would be any way to access a private class member without a member function.
With clever pointer arithmetic, you can read private members of classes. Just watch out for _vtable stuff if the class has virtual members.
Note that this completely violates virtually every rule and best practice of object oriented design.
Example:
class foo { private: int foo1; int foo2; } void bar(foo* theClass) { printf("foo.foo2 = %d", ((int*)theClass)[1]); }
IMHO cleanest solution will be patch cl.hpp so Device class will have method which return cl_device_id
If i am understanding it correctly, we select the device based on its properties(device name or vendor name or whether it supports some extension).
IMHO he just copy pasted code from CLInfo example into his own program which use C interface.
but you can be pretty sure that device which return C++ binding will be in the same order as from C API.