zbtzbtzbt commented on pull request #8500:
URL: https://github.com/apache/incubator-doris/pull/8500#issuecomment-1072971032
> I tried to use template, but get an error when compiling, I have also
tried different ways of writing, all of which are the same error, can someone
help me? thanks
>
use static and constexpr, The following method is also the same error:
```
template <FieldType field_type>
std::shared_ptr<const TypeInfo> get_scalar_type_info_by_template() {
static constexpr TypeTraits<field_type> traits;
static constexpr ScalarTypeInfo p = ScalarTypeInfo(traits);
return std::shared_ptr<const TypeInfo>(&p);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]