I have some code that must remain as c++, but I need to store objective-c objects in these c++ classes. The objects will not be referenced anywhere else while they are stored h
You can call CFRetain and CFRelease under ARC. You are responsible for balancing each CFRetain with a CFRelease, because ARC does not pay any attention to these functions.
There is no CFAutorelease function. You could perform an autorelease using objc_msgSend(myObject, sel_registerName("autorelease"))
. The hoops you are jumping through here should be a red flag that you're doing something that's probably wrong.
Generally it's better under ARC to find a way not to store object references in otherwise-untyped blobs of memory. Note that member variables of C++ objects can be qualified __strong or __weak if you compile them as Objective-C++.
The public SDKs of Mac OS X 10.9 and iOS 7.0 include a CFAutorelease
function, which you can use even under ARC.