News for hackers. Stuff that matters.
Re:Less is Exponentially More (2012) by yuushi on Friday March 09, 2018 @02:31AM (#16550294)
Out of curiosity, what do you use? I hope it isn't back to raw pointers and size_t offsets for lengths. What do you do if you want to pass a container of ... anything around? What's the replacement for:

   U do_something(const std::vector<T>& vec);
Re:Less is Exponentially More (2012) by JamesLeonis on Friday March 09, 2018 @11:15AM (#16552746)
Raw pointers can still be used for pass-by-reference without size.

    U do_something(std::vector<T> const *vec) {
        T item = (*vec)[1];
        ...;
    }
We can get away with this because the type `std::vector<T>` is known at compile time. It goes back to C and passing pointers of structs all over the place.

The const on the right side makes sure the compiler keeps the memory at the pointed location safe like the const used in your initial question.

Re:Less is Exponentially More (2012) by yuushi on Friday March 09, 2018 @03:00PM (#16554497)
Sure, you can pass by pointer instead of reference, but the post also mentioned that they didn't use the STL (hence no std::vector) and I'm curious if that means they used a replacement library or something else.
Re:Less is Exponentially More (2012) by nwatson on Friday March 09, 2018 @04:14AM (#16550598)
My guess: they effectively turned C++ into Python with everything allocated from heap and wrapped with shared pointers ... and custom iterators and collections like old-style RogueWave Tools.h++.
Re:Less is Exponentially More (2012) by kbwt on Friday March 09, 2018 @08:24AM (#16551517)
Not OP but...

    output_type do_something(buffer_view input);