taocpp / taopq

C++ client library for PostgreSQL
Boost Software License 1.0
265 stars 40 forks source link

error: ‘null’ is not a member of ‘tao::pq::result_traits<int>’ #55

Closed kevin143carr closed 2 years ago

kevin143carr commented 2 years ago

I am getting these errors when I build! I have done a fresh clone. -- Thanks Kevin!

include/tao/pq/row.hpp: In instantiation of ‘T tao::pq::row::get(std::size_t) const [with T = int; std::size_t = long unsigned int]’: include/tao/pq/row.hpp:299:40: required from ‘T tao::pq::field::as() const [with T = int]’ src/test/pq/result.cpp:156:10: required from here include/tao/pq/row.hpp:224:50: error: ‘null’ is not a member of ‘tao::pq::result_traits’ return result_traits< T >::null();

include/tao/pq/row.hpp:224:50: required from ‘T tao::pq::row::get(std::size_t) const [with T = std::tuple; std::size_t = long unsigned int]’ include/tao/pq/row.hpp:247:29: required from ‘T tao::pq::row::as() const [with T = std::tuple]’ include/tao/pq/result.hpp:242:40: required from ‘T tao::pq::result::as() const [with T = std::tuple]’ include/tao/pq/result.hpp:263:43: required from ‘auto tao::pq::result::tuple() const [with Ts = {int}]’ src/test/pq/result.cpp:52:4: required from here include/tao/pq/result_traits_tuple.hpp:24:55: error: ‘null’ is not a member of ‘tao::pq::result_traits’ return std::tuple< T >( result_traits< T >::null() );

d-frey commented 2 years ago

What compiler version are you using? The error basically means that the result_traits_has_null-helper is giving the wrong answer or if constexpr is not working correctly on your system.

kevin143carr commented 2 years ago

Gcc 8.3.1 on CentOS 7

On Nov 18, 2021, at 4:20 PM, Daniel Frey @.***> wrote:

What compiler version are you using? The error basically means that the result_traits_has_null-helper is giving the wrong answer or if constexpr is not working correctly on your system.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/taocpp/taopq/issues/55#issuecomment-973280576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBQM7W2RVO6M2VTYQKYU3DUMVUZRANCNFSM5IKTGZXA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

d-frey commented 2 years ago

Our CI job uses GCC 8.4.0. If you can't upgrade your compiler, can you try to create a minimal example based on result_traits_has_null and check whether it detects the existence of null correctly?

kevin143carr commented 2 years ago

Thanks for responding. I will see about upgrading to 8.4.0. I am rebuilding my dev environment now. Otherwise perhaps you could provide me an example of what you are talking about. I am not the greatest at C++ and I am simply trying to compile your library to use with another library.

kevin143carr commented 2 years ago

I upgraded to devtoolset9 and it built properly. So I guess the issue is a C++ functionality not support with 8.3.1 -- Thanks!