Comments (4)
Anyway, the consequence of this is that it can be hard to write a function like below that works generically with labels and const T pointers.
void foo(T, Labels...)(Slice!(const(T)*, 2u, Contiguous, Labels) a) {}
from mir-algorithm.
The lables almost not implemented.
from mir-algorithm.
Mit uses alias this
on toConst
. Maybe updating toConst
could help
from mir-algorithm.
@9il After looking at it for a bit, it is starting to make a bit more sense why you did it this way. The idea is to make the whole thing const, including both values and labels.
The only thing that really jumps out is that the alias toConst this
only applies for when the type is not constant. Here:
static if (!is(Slice!(const(Unqual!(PointerTarget!Iterator))*, N, kind) == This))
This only considers the case where the Iterator is const. What if the iterator is const, but the labels aren't?
And for whatever reason, this doesn't work but would make my life a lot easier if you could
void foo(T, Labels...)(Slice!(const(T)*, 2u, Contiguous, staticMap!(ConstOfUnqualOfPointerTarget, Labels)) a)
You instead have to do something like:
void foo(T)(Slice!(const(T)*, 2u, Contiguous) a) {}
void foo(T, Label1)(Slice!(const(T)*, 2u, Contiguous, const(Label1)*) a) {}
void foo(T, Label1, Label2)(Slice!(const(T)*, 2u, Contiguous, const(Label1)*, const(Label2)*) a) {}
from mir-algorithm.
Related Issues (20)
- Enhance functionality of `RefTuple` `label`s HOT 4
- labels support HOT 9
- Compilation fails on Linux aarch64 with hardfloat HOT 3
- Replace asserts with `should`s
- fuse on array of string HOT 1
- [feature request] Add numpy.genfromtxt() HOT 32
- add static check for supported complier versions directly in the code
- Bitwise operations on `bitSlice` HOT 1
- U+23F4 is graphical as of Unicode v7
- filter and each compiler error HOT 2
- Improve user-friendliness of `shouldApprox` for floating point slices HOT 1
- Sum doesn't work for const(Slice!T*) HOT 1
- `stairs` with 0 or 1 on diagonals HOT 1
- How to reference mir (and lubeck) libraries HOT 2
- 32 bit windows LDC build fails HOT 6
- dmd 2.103.0 deprecation warnings about class/interface alias this HOT 1
- is lightScope of Slice!(RCI!T, N) thread-safe? HOT 1
- Cannot writeln entire object when mixing zip/map
- lightImmutable not handling Labels properly
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 mir-algorithm.