#prog #cpp
doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of magnitude) and runtime compared to other feature-rich alternatives. It brings the ability of compiled languages such as D / Rust / Nim to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface.
Советую также посмотреть, чем отличается от прочих фреймворков для тестирования в C++.
doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of magnitude) and runtime compared to other feature-rich alternatives. It brings the ability of compiled languages such as D / Rust / Nim to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface.
Советую также посмотреть, чем отличается от прочих фреймворков для тестирования в C++.
🔥5🤔2👎1🤣1
TIL что для #cpp есть предложение закрепить в стандарте тот факт, что в байте ровно 8 бит. Сейчас это не так: стандарт (и сишный тоже) требует, чтобы в char было минимум 8 бит, но точное их количество может быть больше, и это количество записано макросом
CHAR_BIT из limits.h/climits.👍6🤡5🫡4😁1
#prog #rust #cpp #article
Type Inference in Rust and C++
<...>My feeling is that literally everything above is indicative of a trade-off pattern.
If you want to have a fancy, bespoke modern type checker with Hindley-Milner type inference semantics, you need to accept one of the following:
1. Bad performance for your type checker with a risk of exponential blow-up.
2. No features that look anything like “the compiler picks the best option out of several ones”. No function overloading, implicit conversions, etc.
Надо отдельно отметить, что deref coercion под "pick the best option out of several ones" не подпадает —
Type Inference in Rust and C++
<...>My feeling is that literally everything above is indicative of a trade-off pattern.
If you want to have a fancy, bespoke modern type checker with Hindley-Milner type inference semantics, you need to accept one of the following:
1. Bad performance for your type checker with a risk of exponential blow-up.
2. No features that look anything like “the compiler picks the best option out of several ones”. No function overloading, implicit conversions, etc.
Надо отдельно отметить, что deref coercion под "pick the best option out of several ones" не подпадает —
Target является у трейта ассоциированным типом, а не параметром, поэтому реализаций Deref у каждого конкретно взятого типа не более одной🤔3