Using optix::Context object instead of optix::ContextObj

Using optix::Context object instead of optix::ContextObj :

Optix Version 6.0

I have some legacy code based on the above version of Optix that is using optix::Context object to create
optix::Buffer object. with “createBuffer” method.

But Optix API appears to suggest that one needs to use optix::ContextObject object which contains with its member function “createBuffer”.

The legacy code was compiled with no issues in the past with Optix 6.
But now it requires me to do the following
optix::Context ctx ;
optix::Buffer buf = ctx.get().createBuffer(…)

If I don’t use the get() method, the compiler complains in the following manner

error: ‘optix::Context {aka class optix::Handleoptix::ContextObj}’ has no member named ‘createBuffer’; did you mean ‘create’?
optix::Buffer ray_hit_buffer = context->createBuffer(


(g++, with CMake(ver 3.10.2), g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0)

the old code just required
optix::Buffer buf = ctx.createBuffer(…)

How can I explain this behaviour? Any pointers would be much appreciated.

Sorry folks. It was my mistake. I was treating Context as a normal object and I was passing it to another object as pointer, not knowing that Context itself is a pointer object. Now I understand the complaint from the compiler.