Yikes. If you're having that issue, what I would suggest doing would be either:
a) Add a comment saying that this needs to be the order and hope it stays up-to-date
b) Wrap it all up into a new class, e.g:
class DrawTestAndroidBuffers
{
public:
// We require std::shared_ptr<struct alloc_device_t as a construction parameter to signify that the relevant mga::AndroidBuffers require it to be around during their lifetime. DrawTestAndroidBuffers (std::shared_ptr<struct alloc_device_t const&) { ... }
What that does is ensure that in order to initialize the android_buffers, you have to have an alloc_device first. The dependency is certainly implicit, but at least any future maintainer will think twice before changing it, and it makes it more difficult to accidentally change the order.
53 + std::shared_ ptr<struct alloc_device_t> alloc_device; ptr<mga: :AndroidBuffer> android_buffer; ptr<mga: :AndroidBuffer> second_ android_ buffer;
54 std::shared_
55 std::shared_
Yikes. If you're having that issue, what I would suggest doing would be either:
a) Add a comment saying that this needs to be the order and hope it stays up-to-date
b) Wrap it all up into a new class, e.g:
class DrawTestAndroid Buffers
{
public:
// We require std::shared_ ptr<struct alloc_device_t as a construction parameter to signify that the relevant mga::AndroidBuffers require it to be around during their lifetime.
DrawTestAndroi dBuffers (std::shared_ ptr<struct alloc_device_t const&) { ... }
std::shared_ ptr<mga: :AndroidBuffer> android_buffer; ptr<mga: :AndroidBuffer> second_ android_ buffer;
std::shared_
};
class DrawTestAndroid Device
{
public:
};
What that does is ensure that in order to initialize the android_buffers, you have to have an alloc_device first. The dependency is certainly implicit, but at least any future maintainer will think twice before changing it, and it makes it more difficult to accidentally change the order.