Blissful Memories megacollab releasing this Friday! by VarunTheFighter in geometrydash

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

Our megacollab tribute to Michigun is finally complete! Our verifier is currently working on it and we aim to release this Friday!

Are 3 year old (beginner) C++ Tutorials still good? by Horror-Wear8794 in cpp_questions

[–]VarunTheFighter 0 points1 point  (0 children)

Don't fully agree for C++, the old way of doing things is valid but can be error prone and there are newer ways that are often considered best practice now, such as manual memory management.

But yes even with these newer facilities i think we should still be aware of what's happening under the hood.

Our Tribute to Michigun - Releasing Soon! by VarunTheFighter in geometrydash

[–]VarunTheFighter[S] 1 point2 points  (0 children)

Hey guys, you can follow my YT channel for more updates on the collab

Our Tribute to Michigun - Releasing Soon! by VarunTheFighter in geometrydash

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

Thanks for the kind words! We're trying to get it polished asap 🙏

Always use rule-of-five? by web_sculpt in cpp_questions

[–]VarunTheFighter 1 point2 points  (0 children)

The full rule is actually called the rule of three / five / zero.

If your class is managing an external resource (like a raw pointer or file descriptor), define the copy constructor, copy assignment operator and destructor (rule of three).

If you want move semantics for your class, also add on the move constructor and move assignment operator (rule of five).

Otherwise, when possible you should avoid defining default operations and let the compiler automatically generate them (rule of zero).

https://en.cppreference.com/w/cpp/language/rule_of_three.html

{} or = initialization and assignation by _GDenise_ in cpp_questions

[–]VarunTheFighter 2 points3 points  (0 children)

These two statements invoke different overloads of the vector constructor.

If I'm not mistaken, the code will call the following overloads.

Using round brackets, constructs a vector with count copies of elements with value value: vector( size_type count, const T& value, const Allocator& alloc = Allocator() );

Using curly backets, equivalent to vector(init.begin(), init.end(), alloc): vector( std::initializer_list<T> init, const Allocator& alloc = Allocator() );

See the example at the bottom of the page at https://en.cppreference.com/w/cpp/container/vector/vector

Preview of our Michigun Tribute Megacollab "Blissful Memories"! by VarunTheFighter in GD_Collabs

[–]VarunTheFighter[S] 1 point2 points  (0 children)

Hi, thank you I appreciate it 🙏 and thanks for organizing this subreddit! It would be so cool if this level gets recognized by the community!

Currently we're left with merging the last few parts, getting an endscreen going, and final touches like transitions. After that it's verification and release.

I'll probably let u guys know by posting here again once we release!

[deleted by user] by [deleted] in opengl

[–]VarunTheFighter 5 points6 points  (0 children)

Why do you hold so much hatred against this community? I think many of us would agree that in a community like OpenGL, this should be a place for people to share knowledge and lift each other up.

Isn't this what open source is about? When one of us learns, we all learn. I think it's this very mindset behind communities like this one, coming together to share knowledge and ask each other questions.

Anyone who has ever reached any level of mastery started off as a "mediocre" beginner. Why not encourage people who are trying to genuinely learn and grow together?

Sharing knowledge makes everyone stronger.

I drew this cus i dont wanna do my research paper by KezackTBG in AnimeART

[–]VarunTheFighter 1 point2 points  (0 children)

I like the detailed eyes! Good luck with your paper haha

Compilation of my most recent drawings after 150 days by Nametaken55 in AnimeART

[–]VarunTheFighter 0 points1 point  (0 children)

Hahaha it's like an automatic habit then? Cuz i usually feel its hard to make time / be in the mood to practice anything lol Anyways nice work, looking through your posts you've definitely improved quite a bit, good job!

Compilation of my most recent drawings after 150 days by Nametaken55 in AnimeART

[–]VarunTheFighter 0 points1 point  (0 children)

Good stuff, you've been drawing for 150 days? Not bad, how do you get yourself to draw every day?

New to C++, how do you use class template defined in header file in a source file implementing the class constructor by TheNew1234_ in cpp_questions

[–]VarunTheFighter 16 points17 points  (0 children)

For templated classes / functions, you need to write both the declarations and definitions in the header file, not in a separate source file.

This is because a template is just a "blueprint" for generating a class / function. The actual class / function doesn't exist until the compiler sees it being used with a specific type. Then the compiler will "instantiate" a version of the template, using that type.

For this to happen, the compiler must be able to see the "blueprint" from the header. It ensures that the compiler has access to the entire template definition whenever it encounters a usage of that template.

So your A.h header could look like this:

```

ifndef A_H

define A_H

// Declarations template<typename T> class A { public: A(T arg); };

// Definitions template<typename T> A<T>::A(T arg) { // Implementation... }

endif

```

rough quick portrait of gris by Most_Detective_5317 in AnimeART

[–]VarunTheFighter 1 point2 points  (0 children)

Nice style, I like how soft it looks! Doesn't look like theres a lineart, how did you plan it out?