timeplus-io / timeplus-cpp

Timeplus C++ client
Apache License 2.0
1 stars 0 forks source link

Compilation Bug: Function Overloading Redundancy #4

Closed Jax-YHH closed 1 month ago

Jax-YHH commented 1 month ago

For supporting decimal256 datatype, the Int128 datatype has been globally updated across the project. The previously used absl library has been deprecated in favor of proton's wide::Integer.

/home/kongsha/develop/timeplus-cpp/ut/client_ut.cpp: In member function ‘virtual void ClientCase_Decimal_Test::TestBody()’:
/home/kongsha/develop/timeplus-cpp/ut/client_ut.cpp:674:19: error: call of overloaded ‘Append(const char [11])’ is ambiguous
  674 |         d1->Append(("12345.6789"));
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /home/kongsha/develop/timeplus-cpp/timeplus/columns/date.h:3,
                 from /home/kongsha/develop/timeplus-cpp/timeplus/client.h:7,
                 from /home/kongsha/develop/timeplus-cpp/ut/client_ut.cpp:1:
/home/kongsha/develop/timeplus-cpp/timeplus/columns/decimal.h:17:10: note: candidate: ‘void timeplus::ColumnDecimal::Append(const Int256&)’
   17 |     void Append(const Int256& value);
      |          ^~~~~~
/home/kongsha/develop/timeplus-cpp/timeplus/columns/decimal.h:18:10: note: candidate: ‘void timeplus::ColumnDecimal::Append(const string&)’
   18 |     void Append(const std::string& value);
      |          ^~~~~~
Jax-YHH commented 1 month ago

Now we use Append(std::string("12345.6789")) to ensure the parameter type.