[libgpiod] Make bitset_cmp::operator() const.

Message ID 20190209150618.19209-1-michaelb@ieee.org
State New
Headers show
Series
  • [libgpiod] Make bitset_cmp::operator() const.
Related show

Commit Message

Michael Beach Feb. 9, 2019, 3:06 p.m.
This fixes build problems with clang and libc++, and such constness is
now required by C++17 (see https://cplusplus.github.io/LWG/issue2542).

Signed-off-by: Michael Beach <michaelb@ieee.org>
---
 bindings/cxx/line_bulk.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bartosz Golaszewski Feb. 10, 2019, 2:16 p.m. | #1
sob., 9 lut 2019 o 16:06 Michael Beach <michaelb@ieee.org> napisaƂ(a):
>
> This fixes build problems with clang and libc++, and such constness is
> now required by C++17 (see https://cplusplus.github.io/LWG/issue2542).
>
> Signed-off-by: Michael Beach <michaelb@ieee.org>
> ---
>  bindings/cxx/line_bulk.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp
> index c93f364..e52d33d 100644
> --- a/bindings/cxx/line_bulk.cpp
> +++ b/bindings/cxx/line_bulk.cpp
> @@ -29,7 +29,7 @@ const ::std::map<int, int> reqtype_mapping = {
>
>  struct bitset_cmp
>  {
> -       bool operator()(const ::std::bitset<32>& lhs, const ::std::bitset<32>& rhs)
> +       bool operator()(const ::std::bitset<32>& lhs, const ::std::bitset<32>& rhs) const
>         {
>                 return lhs.to_ulong() < rhs.to_ulong();
>         }
> --
> 2.17.1
>

Applied, thanks!

Bart

Patch

diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp
index c93f364..e52d33d 100644
--- a/bindings/cxx/line_bulk.cpp
+++ b/bindings/cxx/line_bulk.cpp
@@ -29,7 +29,7 @@  const ::std::map<int, int> reqtype_mapping = {
 
 struct bitset_cmp
 {
-	bool operator()(const ::std::bitset<32>& lhs, const ::std::bitset<32>& rhs)
+	bool operator()(const ::std::bitset<32>& lhs, const ::std::bitset<32>& rhs) const
 	{
 		return lhs.to_ulong() < rhs.to_ulong();
 	}