[bind10-dev] IntElement type

fujiwara at jprs.co.jp fujiwara at jprs.co.jp
Mon Jul 1 08:16:04 UTC 2013


C++ Element interface offers create(value), getValue(&variable),
setValue(value) for integer, double, boolean, string, vector, map
values.

integer values or variables have many different types:
   (unsigned | signed) (char | short | int | long | long long)
   (uint | int ) (8 | 16 | 32 | 64) t

We decided to change the type of IntElement from long int to int64_t.

getValue(&integer_variable) method requires integer variable which
type is same as intElement.

Due to C++ overloading problem, mixing int64_t and native types (long
long int, long int) does not work well.

There are two choices.

1. Suppose "long long int" is 64bit signed integer.
   Change the type of IntElement from long int to long long int.
   Prepare create(long int) and create(int).

2. Change the type of IntElement from long int to int64_t.
   Add static cast to int64_t where compile errors occur.

Which do you like better, "long long int" and "int64_t" ?

--
Kazunori Fujiwara, JPRS <fujiwara at jprs.co.jp>


More information about the bind10-dev mailing list