News for hackers. Stuff that matters.
Re:C++26: Pack Indexing by almostgotcaught on Saturday January 25, 2025 @04:48AM (#42820626)
Bro fold expressions are great and all but Jesus Christ the name spacing in that file. Like have you ever heard of this hidden C++ feature called `using namespace`?
Re:C++26: Pack Indexing by a_t48 on Saturday January 25, 2025 @12:46PM (#42823204)
Yes, and? It's much easier to remove namespaces later using `using namespaces` if it really becomes a maintenance hazard than to go through and add them all back. This is library code that was intended to be included with unknown customer code, part of the goal is to avoid namespace collisions. (The `basis::` prefixes should go, though, the entire file is inside `basis`)
Re:C++26: Pack Indexing by almostgotcaught on Saturday January 25, 2025 @02:58PM (#42824277)
> It's much easier to remove namespaces later using `using namespaces`

lol how? sed? that's not a "much easier", that's a hack. it's actually much easier to remove `using namespace` because then the compiler will catch resolution errors.

i actually didn't notice this was a header in which ok fine don't use `using namespace` but still this is java EE levels of boiler plate you've got going on;

  void SetupInput(const basis::UnitInitializeOptions &options,
                  basis::core::transport::TransportManager *transport_manager,
                  basis::core::containers::SubscriberQueueSharedPtr &subscriber_queue,
                  basis::core::threading::ThreadPool *thread_pool,
                  const std::unordered_map<std::string, std::string> &templated_topic_to_runtime_topic) {

this signature is 90% namespace resolution - i have to squint to actually find the types...
Re:C++26: Pack Indexing by a_t48 on Saturday January 25, 2025 @03:07PM (#42824363)
Look I agree, it could be more readable. :)