Skip to content

Commit f4b7393

Browse files
committed
I always have compiler problems when using operator[](unsigned) when I pass int instead, so I added a note to the comments.
1 parent 9f8abcb commit f4b7393

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/json/value.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,12 @@ namespace Json {
271271
/// Access an array element (zero based index ).
272272
/// If the array contains less than index element, then null value are inserted
273273
/// in the array so that its size is index+1.
274+
/// (You may need to say 'value[0u]' to get your compiler to distinguish
275+
/// this from the operator[] which takes a string.)
274276
Value &operator[]( UInt index );
275277
/// Access an array element (zero based index )
278+
/// (You may need to say 'value[0u]' to get your compiler to distinguish
279+
/// this from the operator[] which takes a string.)
276280
const Value &operator[]( UInt index ) const;
277281
/// If the array contains at least index+1 elements, returns the element value,
278282
/// otherwise returns defaultValue.

0 commit comments

Comments
 (0)