Namespaces
Variants
Actions

User talk:Ybab321

From cppreference.com

front page proposal

The one on User:Yaossg has a much better chance, I think: it needs to be shorter than what is currently at Main_Page, not longer, to work as a usable landing page. Even if one were to build a page where all second-level links are brought to the front page, why hide std::copy and show std::time_put_byname? --Cubbi (talk) 06:55, 19 December 2017 (PST)

That's all completely fair and I agree that Yaossg's proposal is superior. My objective was to expose all of the classes out onto the front page, as that's usually what I'm looking for when I come onto cppreference; I had no idea there would be so many of them in the end! Ultimately, the version I have on my user page is preferable for my particular usage and I'm not proposing to replace the main page contents with it. I'd like to let it live without putting a maintenance burden on anyone else, but if you or anyone else would prefer for it to be removed or erased, I'm happy to download the page as is and use it as an offline bookmark. --Ybab321 (talk) 07:37, 19 December 2017 (PST)
Ah, I thought you were preparing a competing proposal. Of course you can have whatever on a user page. --Cubbi (talk) 08:18, 19 December 2017 (PST)
I'm happy to hear that and glad we could resolve the confusion. --Ybab321 (talk) 08:24, 19 December 2017 (PST)

operator new confusion

nothrow is implemented by

try
{
    operator new(sz)
}
catch(std::bad_alloc const&)
{
    return nullptr;
}


1. It still introduces the runtime of C++ exceptions which bloats your binary size for 100 kb. bad_alloc is still there internally.

2. nothrow const& is terrible since you pass a reference to a null object. That is a total waste of register. You pass an address to an empty object which is absurd.

3. std::bad_alloc is terrible since you have no way to handle allocation failure safely. Many OS has the overcommit mechanism. -- Cqwrteur

Absolute non-sense. Just implement void* operator new(std::size_t count, const std::nothrow_t&) if you don't want to throw, this wiki is for generally applicable standard conforming code --Ybab321 (talk) 03:29, 12 February 2021 (PST)

The clause in qualified lookup does not need restore.

Hello Ybab321:

"including those introduced into the global namespace by a using declaration" is missleading there, normal lookup rule for namespace member applies for the global namespace, but it implies that there's some difference for `::`, which is not true. Readers should just refer to the linked section below. It's not necessary to only mention using declarations, as if using directives were not found. If we want emphasis it here, the whole rule should be memtioned exhaustively, such as recursively nested inline namespaces and ones introduced by using in them, ...

It was introduced because the original expression is "declarations **made** in the global namespace", thus using declarations do make a difference, but I changed it to declarations in the global namespace, which means the complier behaves as other lookups for declarations, where they are **made** is not taken into account.

OK that's fair, I can see how that comment would mislead readers into thinking there's a special rule for global namespace lookup. Thanks for the rationale, it's much appreciated --Ybab321 (talk) 03:54, 9 October 2024 (PDT)