Comments (1)
Further investigation shows that template <template <typename> class X>
can match something like e.g. std::vector
only since C++17:
https://cplusplus.github.io/CWG/issues/150.html
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html
The suggestion therefore would be to have
- the variadic version in C++14
- the non-variadic one in C++17
maybe using a macro or so.
Possible cross-test:
// C++17 only, since QVLA has a non-type template parameter
void TestAlgorithms::transformedChangeContainerAndDataType3()
{
QVector<int> vec{1, 2, 3, 4};
const auto toString = [](int i) { return QString::number(i); };
auto result = KDAlgorithms::transformed<QVarLengthArray>(vec, toString);
QVarLengthArray<QString> expected{"1", "2", "3", "4"};
QCOMPARE(result, expected);
}
from kdalgorithms.
Related Issues (16)
- `copy` has to cope with self-copying HOT 1
- Should `min_element` and `max_element` be called `min_value` / `max_value`? HOT 1
- Constrain the boolean operators
- kdalgorithms::max_value_less_than could check if it can call lower_bound
- Range-ify the code
- transform compile error in Visual Studio HOT 11
- reserve_helper type conversion warning HOT 2
- Eradicate calls to .begin(), .end(), .cbegin(), .cend()
- find_if creates dangling references for r-value references.
- min_element() fails to compile on custom container without an empty() method
- gcc 13 warns about extra std::move() calls
- kdalgorithms::remove_duplicates doesn't work if the type is not sortable
- `remove` / `remove_if` are supposed to be spelled `erase`
- In `remove` / `remove_if` consider C++20's uniform erasure protocol
- In `remove` / `removeIf`, return the number of deleted elements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kdalgorithms.