interval converting constructors and assignment are unconstrained: every type claims to convert
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
The unconstrained converting constructors and operator= are declared in interval.hpp, so start there and check which overloads accept any T1. Constrain them so only intended arithmetic types convert, then compile the static_asserts from the issue to confirm std::is_convertible is false for std::string, unrelated and void*. Pull request #57 already targets this, so read it and coordinate with its author before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #47, as requested there.
interval<T, Policies> declares (interval.hpp, develop at 3957843):
template<class T1> interval(T1 const &v);
template<class T1, class T2> interval(T1 const &l, T2 const &u);
template<class T1> interval &operator=(T1 const &v);
None of them is constrained, and the constructors are not explicit. So an interval claims to be implicitly convertible from any type. This compiles:
#include <boost/numeric/interval.hpp>
#include <string>
#include <type_traits>
typedef boost::numeric::interval<double> I;
struct unrelated {};
static_assert(std::is_convertible<std::string, I>::value, "");
static_assert(std::is_convertible<unrelated, I>::value, "");
static_assert(std::is_convertible<void*, I>::value, "");
static_assert(std::is_constructible<I, std::string, unrelated>::value, "");
static_assert(std::is_assignable<I&, std::string>::value, "");
int main() {}
Effects
- Overload sets that include an interval become ambiguous.
- Generic libraries that select overloads with
is_convertibleare misled. With Eigen 3.4.0 andEigen::NumTraits<I>specialised,A * Bfor twoEigen::Matrix<I, 2, 2>is ambiguous, because the scalar-times-matrix overloads see the matrix as convertible to the scalar type.A.lazyProduct(B)works. This is the case from #47. - Bad arguments are reported from inside
interval.hppinstead of at the call site.
- Ngôn ngữ chính
- C++
- Star
- 31
- Fork
- 49
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/interval
-
Emscripten compilation issueĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
-
Code behaves differently if compiled with MSVC vs GCCCó thể đã có người làm @reach2sayan đã nhận 2 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Tất cả issue của boostorg/interval
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
metasequoiaime/msime#9113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
tone-3000/tone3000-plugin#257 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Locked plugin flip-flops position on every refresh after being disabledCó thể đã có người làm @Illustar0 đã nhận hôm nay. Đang mởissue report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ModOrganizer2/modorganizer#2449 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement P5
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
open-astro/AlpacaBridge#1468 ·
Maintainer thường phản hồi trong vòng 1 ngày