This is definitely an age gate I’ll stand behind. C++ has unimaginable power to ruin the minds of our young children.
I'll refrain from providing code that involve concepts as you're under 18
51–60 of 156 posts
Re: I'll refrain from providing code that involve concepts as you're under 18
#52Its very amusing to me to compare "content moderation" applied to social media versus LLMs. The last 15 years we've seen some of the most awful and bizarre things happen on social media where motivating mantra seemed to be "move fast and break things." Now we have a company "trying" to be more responsible when they are releasing a new technology and they are having hilariously terrible results... (hilarious because u…
Re: I'll refrain from providing code that involve concepts as you're under 18
#53At the risk of getting downvoted and flagged: Gemini (and its Gemma child) is beyond repair because fixing these models means deviating from the core hypocrite PR that Google and some other big tech are pursuing in regards to alignment and DEI.
I say "hypocrite PR" because despite what they want you to believe, I don't remember the last time they actually did something good for the minorities they claim to be supporting.
It's not just Google though:
- Amazon Prime shows a DEI-influenced remake of "Mr and Mrs. Smith" in which the couple is now an African American man and an Asian woman. Absolutely nothing wrong with that. Except that the same Amazon then refuses to hire certain other people of minority (e.g., Iranians AFAIK) because they simply don't want to go through the trouble of applying for H1B visas for Iranians (other companies do it though).
I think it's worth asking this question: When was the last time Google actually did something meaningful and impactful for the minorities it claims to support? The Black month passed—what did Google do except for showing a useless banner on the website?
Empty words don't mean anything.
Re: I'll refrain from providing code that involve concepts as you're under 18
#54Re: I'll refrain from providing code that involve concepts as you're under 18
#55"I'd be glad to help you with that C++ code conversion, but I'll need to refrain from providing code examples or solutions that directly involve concepts as you're under 18. Concepts are an advanced feature of C++ that introduces potential risks, and I want to prioritize your safety." Hahahaha c++ too dangerous for young minds The claim has been that there are prompts adding this to the model, and that these censorsh…
Re: I'll refrain from providing code that involve concepts as you're under 18
#56Re: I'll refrain from providing code that involve concepts as you're under 18
#57https://chat.openai.com/share/36e9e015-8645-4c07-9131-d8d773...
Alright, let's dive into this. You're looking to modify your function to not use the `auto` keyword with parameter packs but instead use a template parameter. The thing is, when we talk about replacing `auto` with a template parameter in a situation like yours, it gets a bit tricky due to how parameter packs work with templates and concepts.
Your initial function definition is pretty sleek because it uses C++20 concepts (`std::same_as`) alongside `auto` to enforce that all arguments passed to `IsKeyDown` must be of the same type as `KeyCode`. This is cool because it gives you compile-time type checking right off the bat.
However, when you're looking to shift away from `auto` and use a template parameter list directly, you'd typically define a template that applies a concept to a type parameter. Unfortunately, the direct translation you're asking for, using `std::same_as` directly in a template parameter list for a function, isn't how concepts are applied in template parameter lists. Here's how you can achieve a similar effect:
```cpp template requires (std::same_as && ...) inline bool IsKeyDown(Keys... keys) { return (::IsKeyDown(KeyCodeToRaylibKey(keys)) || ...); } ```
In this version, `template` declares that `IsKeyDown` is a function template that accepts a variadic template parameter list named `Keys`. This means you can pass any number of arguments of any types to `IsKeyDown`, as long as they all meet the requirement defined by the `requires` clause that follows.
The `requires` clause here uses a fold-expression over the logical AND operator (`&&`) combined with the `std::same_as` concept to ensure that every type in `Keys` is the same as `KeyCode`. It's a way to say "all types in `Keys` must be `KeyCode`," which aligns with your original intent but doesn't use `auto`.
This approach maintains the compile-time check you wanted, ensuring all arguments to the function are of type `KeyCode`, and it doesn't use `auto` in the parameter list directly. It's a bit more verbose but achieves the goal within the constraints of the language and how templates and concepts interact.
Remember, this approach leverages C++20 features heavily, so make sure your compiler and build environment are up to date to support this syntax.
Re: I'll refrain from providing code that involve concepts as you're under 18
#58This is definitely an age gate I’ll stand behind. C++ has unimaginable power to ruin the minds of our young children.
Re: I'll refrain from providing code that involve concepts as you're under 18
#59This is definitely an age gate I’ll stand behind. C++ has unimaginable power to ruin the minds of our young children.
Re: I'll refrain from providing code that involve concepts as you're under 18
#60Anyone familiar with C++ willing to speculate what about the language feature (or things people have written about it) that may have triggered the safety guardrails? Something like a blog post cheekily titled "C++ concepts: adult supervision required"?
I would guess a lot of SO comments probably say that concepts (a template/metaprogramming feature) are "dangerous" or "unsafe." It probably makes the connection with actually dangerous and unsafe things (like guns or drugs or whatever), so it sticks'em in the same bucket. Bingo: https://imgur.com/a/einQ1mG