mirror of
https://github.com/SOCI/soci.git
synced 2026-01-06 05:00:33 -06:00
Define soci::ssize() for C arrays too
It might be better to replace arrays with std::array but for now just make it possible to use ssize() in the existing code.
This commit is contained in:
@@ -40,6 +40,12 @@ constexpr ssize_t ssize(C const& c)
|
||||
return static_cast<ssize_t>(c.size());
|
||||
}
|
||||
|
||||
template <typename T, int N>
|
||||
constexpr ssize_t ssize(T (&)[N]) noexcept
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
||||
#endif // C++20/!C++20
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user