ccapi icon indicating copy to clipboard operation
ccapi copied to clipboard

Failed to specialize function template 'unknown-type date::parse

Open kv-gits opened this issue 3 years ago • 1 comments
trafficstars

On Windows (MSVC) get this error during compile

ccapi_util_private.h:278: Error: C2893: Failed to specialize function template 'unknown-type date::parse(const std::basic_string<CharT,Traits,Alloc> &,Parsable &)' ......\contrib\ccapi_cpp/ccapi_date.h(5506): note: see declaration of 'date::parse' ......\contrib\ccapi_cpp/ccapi_util_private.h(278): note: With the following template arguments: ......\contrib\ccapi_cpp/ccapi_util_private.h(278): note: 'Parsable=ccapi::TimePoint' ......\contrib\ccapi_cpp/ccapi_util_private.h(278): note: 'CharT=char' ......\contrib\ccapi_cpp/ccapi_util_private.h(278): note: 'Traits=std::char_traits' ......\contrib\ccapi_cpp/ccapi_util_private.h(278): note: 'Alloc=std::allocator'

kv-gits avatar Jan 06 '22 11:01 kv-gits

Hi, kv-gits, thank you for reaching us. This issue is known to us: https://github.com/crypto-chassis/ccapi/issues/85. However, recently we're in the process of ramping up production of our proprietary market making currently operating at a trading volume of $550M per week to the next new level for a trading firm. Therefore there's little time left for us to figure out issues here, plus none of us uses Windows. If you are willing to make a pull request to fix it, I'd be more than glad to accept it. Otherwise, for a short term workaround, you can try MinGW which has always been made sure to pass the CI: https://github.com/crypto-chassis/ccapi/runs/4660875789?check_suite_focus=true. We apologize.

cryptochassis avatar Jan 07 '22 01:01 cryptochassis

Hi kv-gits. I found the root cause of the issue. The reason of this error is that new Visual Studio IDE comes with chrono which contains from_stream template functions. During compilation the compiler is confused and doesn't know which version to use (the one defined in ccapi_date.h or in chrono header). This issue appears while compiling using C++20 standard (and will in case of newer standards in the future most probably). To solve this issue the from_stream in ccapi_date.h file must be either renamed (and eventually renamed in all places where it occurs in ccapi project) or placed in a namespace or excluded from compilation while using newer (at least C++20) standard or... (any other valid approach).

kamil7165 avatar Jun 17 '23 17:06 kamil7165

Noted. Thank you very much for providing the details. We are working on devising a best approach to solve it soon. WIP: https://github.com/crypto-chassis/ccapi/pull/395

cryptochassis avatar Jun 18 '23 16:06 cryptochassis

Fixed.

cryptochassis avatar Jun 21 '23 02:06 cryptochassis