Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor from iterators is not properly constrained #69

Closed
krsch opened this issue Jul 28, 2021 · 1 comment
Closed

Constructor from iterators is not properly constrained #69

krsch opened this issue Jul 28, 2021 · 1 comment

Comments

@krsch
Copy link

krsch commented Jul 28, 2021

Example: https://godbolt.org/z/9MTYWPYqG
Fails with span-lite, works with std::span (e.g. by enabling -std=c++20)
The problem is that int& is convertible_to float const&. This is not true for int* and float const* so I think pointers can be used in span_REQUIRES_T on line 956, but I'm not sure if this solution has no other bugs.

@martinmoene
Copy link
Owner

Thanks!

martinmoene added a commit that referenced this issue Oct 2, 2021
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Oct 13, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Oct 13, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Oct 13, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Oct 14, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Oct 14, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
halstead pushed a commit to openembedded/meta-openembedded that referenced this issue Nov 2, 2021
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit d46c811)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Fixes:

Properly constrain constructor from iterators
(martinmoene/span-lite#69)
Add [noreturn] to throw_out_of_range()
(martinmoene/span-lite#73)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants