pimpl-idiom
Avoid leaking out external types in a C++ class
I have a class defined in a header like so (abbreviated): class CairoRenderer { public: CairoRenderer(); ~CairoRenderer();[详细]
2023-04-12 23:13 分类:问答Linker error while implementing pimpl idiom
Edited to provider a little more clarity. Apologies for confusing everyone. This is under Windows. I have a static library that开发者_运维百科 implements a class using the pimpl idiom. The pimpl hea[详细]
2023-04-09 11:10 分类:问答Is there any advantage to the pimpl idiom with a templated class?
It is my understanding that the primary b开发者_运维知识库enefit of the pimpl idiom is to hide the data members in the implementation file instead of the header. However, templates need to be fully de[详细]
2023-04-08 09:12 分类:问答Typecasting structs to hide implementation vs pimpl-idiom
I know about the pimpl-idiom which in C would look something like this: // foobar.h struct FooBar { char *someString;[详细]
2023-03-24 19:34 分类:问答Pimpl idiom and internal object collaboration without friend declaration
I\'m implementing several classes using the pimpl idiom and am coming across some design issues. Firstly, I\'ve always seen pimpl done like this[详细]
2023-03-15 15:58 分类:问答How do you exchange private data with Pimpl without exposing your internals?
If you have an object B that needsa copy of a private member of 开发者_运维技巧an object A, and the private member is hidden by a Pimpl, how do you make it happen without exposing your internals?[详细]
2023-03-04 03:36 分类:问答Hiding a C++ class in a header without using the unnamed namespace
I am writing a C++ header in which I define a class A { // ... }; that I would like to hide from the outside world (because it may change or even be removed in future versions of this header).[详细]
2023-02-28 09:01 分类:问答Is pimpl compatible with anonymous namespaces?
I am trying to use the pimpl pattern and define the implementation class in an anonymous namespace. Is this possible in C++? My failed attempt is described below.[详细]
2023-02-27 09:44 分类:问答Pimpl framework comments/suggestions requested
I\'ve basically implemented a proposal, my question is, has it been done, and if so, where? And/or is there a better way to do what I\'m doing? Sorry about the length of this post, I didn\'t know a be[详细]
2023-02-24 13:09 分类:问答pimpl: Avoiding pointer to pointer with pimpl
In this question I asked \"pimpl: shared_ptr or unique_ptr\" I\'ve been convinced that the proper usage of the pimpl idiom is to use a unique_ptr, not a shared_ptr. It should act to the user as if the[详细]
2023-02-23 05:34 分类:问答