Skip to content
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

Merged
merged 3 commits into from Jul 4, 2015
Merged

Add GenericDocument ctor overload to specify JSON type. #369

merged 3 commits into from Jul 4, 2015

Conversation

mloskot
Copy link
Contributor

@mloskot mloskot commented Jun 26, 2015

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.

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.
@miloyip
Copy link
Collaborator

miloyip commented Jun 27, 2015

Please add(copy) the doxygen API documentation.

Update also documentation of the existing GenericDocument constructor.
@mloskot
Copy link
Contributor Author

mloskot commented Jun 30, 2015

@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) :
Copy link
Contributor

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).
@mloskot
Copy link
Contributor Author

mloskot commented Jul 1, 2015

@pah Good point, I have added the explicit specifier.

@pah
Copy link
Contributor

pah commented Jul 3, 2015

👍 on this one.

miloyip added a commit that referenced this pull request Jul 4, 2015
Add GenericDocument ctor overload to specify JSON type.
@miloyip miloyip merged commit 709daab into Tencent:master Jul 4, 2015
@miloyip
Copy link
Collaborator

miloyip commented Jul 4, 2015

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants