justin = {
main feed
,
music
,
code
= {
cockos
,
reaper
,
wdl
,
ninjam
,
jsfx
,
more
}
,
askjf
,
pubkey
};
Ask Justin Frankel
No reasonable question unanswered since 2009!
Suggested topics: programming, music, sleep, coffee, etc.
Note: please do not ask questions about REAPER features, bugs or scheduling, use the
forums
instead.
Name:
Ask:
Human (enter yes):
[
back to index
] | [
unreplied
] | [
replied
] | [
recent comments
] | [
all
]
Question:
With the recent .Prealloc() improvement for the containers do you ever see a need for .begin()/.end() for those who wish to use range loops and the algorithm header? Thanks
Asked by Gio (79.130.181.x) on August 6 2024, 9:46am
Reply on August 6 2024, 10:29pm:
I suppose it would be easy to add these wrappers, what do you suggest?
Comments:
Posted by Gio (79.130.181.x) on August 7 2024, 2:17am:
It's just a suggestion to have in mind, I will say that I trust your judgement on the matter. Personally, I wouldn't like too much STL-ly things in WDL but I can't deny that it might be handy for those who want to use C++11 features.
Posted by
Justin
on August 7 2024, 4:08pm:
done, for some, so you can use the for (:) syntax which is kinda nice. Maybe someday we'll move to C++11.
Posted by Gio (79.130.181.x) on August 8 2024, 2:59am:
Modernization has been a big problem with C++, often stubbornly stay to old style because I don't want to have more that one style in my codebases. Put some thought on it ten years ago and I found that template aliases might be a nice fit with WDL for some small things that do explicit allocations. I'll probably revisit the idea when I move to a compiler that supports templates aliases. It will be nice to have WDL_UniquePtr, and wdl_rotate, etc.
Posted by Gio (79.130.181.x) on August 8 2024, 7:29am:
Just made a quick range loop test for the containers, everything works nicely. I assume that intentionally didn't include non-const ::begin()/::end(), did you had any concerns about providing modifiable lvalue for the containers? Now, I need to test more and do some planning for eleven... :)
Posted by Gio (79.130.181.x) on August 8 2024, 11:33am:
I would like to point out that a range loop iteration with WDL_PtrList, works only with const items as is; which I think defeats the purpose when there are countless WDL_PtrList in most cases. Probably, addition of non-const versions of ::begin()/::end() would be the right thing to do with the containers if WDL is going to provide that extra functionality as well. Fingers crossed...
Posted by Gio (79.130.181.x) on August 8 2024, 11:47am:
Fix html error: ``countless WDL_PtrList'' = countless WDL_PtrList-WDL_FastString-
Posted by
Justin
on August 8 2024, 7:30pm:
hmm yeah non-const versions would be good too
Comment:
Your Name:
-- Site Owner's Name:
(for human-verification) Comment:
[
back to index
] | [
unreplied
] | [
replied
] | [
recent comments
] | [
all
]
Copyright 2024 Justin Frankel
.
|
RSS