-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GenericDocument ctor overload to specify JSON type. #369
Conversation
It unifies the interfaces with Value where kXXXType can be passed into constructor. It enables shortcut that helps to avoid extra SetXXX() call following construction of a document.
Please add(copy) the doxygen API documentation. |
Update also documentation of the existing GenericDocument constructor.
@miloyip Docs updated. |
\param stackCapacity Optional initial capacity of stack in bytes. | ||
\param stackAllocator Optional allocator for allocating memory for stack. | ||
*/ | ||
GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to mark this constructor as explicit
to avoid accidentally creating a temporary GenericDocument
from a Type
enum value (because all arguments but the first one are optional).
Strictly speaking, the same applies to the "default" constructor below, but is less important as allocator pointers may not be used as frequently in user code.
@pah recommended to mark this constructor as explicit to avoid accidentally creating a temporary GenericDocument from a Type enum value (because all arguments but the first one are optional).
@pah Good point, I have added the |
👍 on this one. |
Add GenericDocument ctor overload to specify JSON type.
thanks |
It unifies the interfaces with Value where kXXXType can be passed
into constructor.
It enables shortcut that helps to avoid extra SetXXX() call following
construction of a document.