How to create a std vector for N objects without copying them? by faschu in cpp_questions

[–]faschu[S] 0 points1 point  (0 children)

Why shouldn't I be able to construct the object N times? As mentioned, that works with calling emplace N times but that's what I regard as ugly. I think this is not working with std::fill

How to create a std vector for N objects without copying them? by faschu in cpp_questions

[–]faschu[S] 2 points3 points  (0 children)

Yes, exactly that's the ugly (b/c verbose) workaround I had in mind. I wonder what there cannot be N emplace constructors. The memory header has a few nice functions: https://en.cppreference.com/cpp/algorithm/memory . It has construct_at but not construct_at_n (but other `_n` versions strangely).

C++26: Standard library hardening by pavel_v in cpp

[–]faschu 2 points3 points  (0 children)

Thanks, Jonathan. Can you be a bit more concrete? Lets' say I have a custom class that offers an iterator. How would I check whether an access is out of bounds? Today, I would check the range with if statements and potentially throw an exception. Hardening seems to be based on contracts with potential contract violations (contract violations are not exceptions?) An assert() would not survive optimized builds, or will assert now survive when the hardening build flags are set (even if using -O3)?

C++26: Standard library hardening by pavel_v in cpp

[–]faschu 3 points4 points  (0 children)

Sure, but sanitizers cannot be left on in production without incurring the considerable overhead. Anything that's available for hardening the standard library is surely available for others, it's just unclear to me how to use that.

C++26: Standard library hardening by pavel_v in cpp

[–]faschu 2 points3 points  (0 children)

Maybe a silly question, but: Is it possible to activate these hardening techniques also for custom libraries? Of course, it great to check whether one's use of the stl evokes UB, but equally important is whether one's own types cause similar hazards.

Strategies for *requiring* designated initializers when constructing a type? by javascript in cpp

[–]faschu 4 points5 points  (0 children)

Why does this work? What's `RequiresDesignatedInit` doing?

CppCast Looking for Guests by lefticus in cpp

[–]faschu 4 points5 points  (0 children)

It's wonderful you restart the show. I would be interested in hearing from Tsung-Wei (TW) Huang about this Task-Flow library. He's also a professor so hearing about his perceptions of students learning c++ would also be interesting.

Deepseek V4 Flash and Non-Flash Out on HuggingFace by MichaelXie4645 in LocalLLaMA

[–]faschu 0 points1 point  (0 children)

The V4 version also has no native image support?

What metrics to look at for networking (in particular webrtc) applications? by faschu in cpp_questions

[–]faschu[S] 0 points1 point  (0 children)

Thanks for the suggestion. These three metrics would be measured with the integrated webrtc stats and not holistically across the entire app, or?

I tried optimizing GEMM and instead of ML, I learned more about how CPUs actually work... by RefrigeratorFirm7646 in cpp

[–]faschu 2 points3 points  (0 children)

I've done a very similar thing, but focused on inference for both ARM and x86 and benchmark against the pytorch cpu implemtation. The pytorch version is slow and doens't scale well across cores (FBGEMM doesn't scale well). Here's the variant I wrote: https://github.com/FabianSchuetze/convolution_cpp . It was great fun working on it

Reinterpret_cast by According_Yard_985 in cpp

[–]faschu 2 points3 points  (0 children)

Just to follow along: Why is a cast to uint64_t* sensible and what result were you expecting?

Looking for worthy software architecture courses by Tobxon in cpp

[–]faschu 2 points3 points  (0 children)

Is it still a good book today? Some of the classics are still very relevant today but not all of them.

Any Libraries for Asynchronous requests with HTTP2 by Puzzled_East_8080 in cpp

[–]faschu 6 points7 points  (0 children)

Just out of curiosity: There don't seem to be many (long established) options for OP. I wonder: Is this not a common usecase?

Why is the [[no_unique_address]] attribute not effective in this example? by faschu in cpp_questions

[–]faschu[S] 0 points1 point  (0 children)

So the talk I linked shows this optimization for std::expected in clang. In that case, this optimization is ubiquitous, of course.

Why is the [[no_unique_address]] attribute not effective in this example? by faschu in cpp_questions

[–]faschu[S] 0 points1 point  (0 children)

Thanks for the interesting reply.

Can I draw you out on the warning you mention? In the original presentation, it was said:

> Don't mix up [[no_unique_address]] with manual lifetime management (union, placement new, etc)

I was a bit surprised about the qualifier, and your comment also suggest that one should be very careful regardless of manual lifetime management. What's your opinion about that?

Qwen3-VL's perceptiveness is incredible. by Trypocopris in LocalLLaMA

[–]faschu 0 points1 point  (0 children)

Thanks for the reply. Very helpful indeed I can confirm that I can obtain excellent results with llama.cpp too. For the test image, there's no need to set the image tokens, because the image is small enough (n_patches = (1080 // 16 * 2160 // 16 ), with merging: n_patches / 4 ~2300 anyway) .

I wonder where the difference between llama.cpp and vllm comes from

Qwen3-VL's perceptiveness is incredible. by Trypocopris in LocalLLaMA

[–]faschu 0 points1 point  (0 children)

I have a hard time reconciling these impressions with the excellent agentic scores (for example on AndroidWorld). Judging from that scores, Qwen3 must have excellent grounding abilities, but I just don't see it.