u/Appropriate-Bill9165

WHO THE HELL IS USING std::print

I hate to say it… but using `std::print` / `std::println` in C++ feels wrong to me.

I know they’re modern.
I know they’re “cleaner”.
But every time I see them in code… something feels off.

Maybe it’s because C++ was never just about convenience.
It was about control.

And somehow:

std::cout << value << '\\n';

still feels more *C++* than:

std::println("{}", value);

Even compile-time thoughts start creeping in.
What gets instantiated?
What gets parsed?
What hidden machinery am I pulling in just to print text?

It’s strange.
Technically better doesn’t always *feel* better.

Sometimes old C++ idioms just fit the language soul more.I hate to say it… but using std::print / std::println in C++ feels wrong to me.I know they’re modern.
I know they’re “cleaner”.
But every time I see them in code… something feels off.Maybe it’s because C++ was never just about convenience.
It was about control.And somehow:std::cout << value << '\\n';
still feels more C++ than:std::println("{}", value);
Even compile-time thoughts start creeping in.
What gets instantiated?
What gets parsed?
What hidden machinery am I pulling in just to print text?It’s strange.
Technically better doesn’t always feel better.Sometimes old C++ idioms just fit the language soul more.

reddit.com
u/Appropriate-Bill9165 — 3 days ago

SPSC Queue

I am working in network visualizer and i want to store the data in SPSC Queue, and this my implementation, is this correct way? or i should reffer to another way to store the data, since the capture thread must never wait for the analysis thread.

#pragma once

#include &lt;atomic&gt;

#include &lt;vector&gt;

namespace NVM {

`template&lt;typename T&gt;`

`class Containers {`

`private:`

	`std::vector&lt;T&gt; container;`

	`std::atomic&lt;size_t&gt; tail{ 0 };`

	`std::atomic&lt;size_t&gt; head{ 0 };`

	`size_t capacity;`

`public:`

	`Containers(size_t size) : container(size), capacity(size){}`



	`bool push(const T&amp; data)` 

	`{`

		`size_t current_tail = tail.load(std::memory_order_relaxed);`

		`size_t next_tail = (current_tail + 1) % capacity;`

		`if (next_tail == head.load(std::memory_order_require)) return false;`

		`capacity++;`

		`container[current_tail] = data;`

		`tail.store(next_tail, std::memory_order_release);`

		`return true;`

	`}`



	`bool pop(T&amp; data)`

	`{`

		`size_t current_head = head.laod(std::memory_order_relaxed);`

		`if (next_tail == tail.load(std::memory_order_require)) return false;`

		`data = container[current_head];`

		`head.store((current_head + 1) % capacity, std::memory_order_release);`

		`return true;`

	`}`

`};`

}

reddit.com
u/Appropriate-Bill9165 — 10 days ago

best GUI library/framework with npcap

i want to make a network visual monitor using npcap with best modern UI, so what do you recommend for me?

note: mainly i know QT but its too complicated to use with npcap

reddit.com
u/Appropriate-Bill9165 — 11 days ago

What i the best GUI library or framework for the production?

i want to make a network visual monitor using npcap with best modern UI, so what do you recommend for me?

note: mainly i know QT but its too complicated to use with npcap

reddit.com
u/Appropriate-Bill9165 — 11 days ago