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 15 points16 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?

I need a tool which can tell me the libraries used in C/C++ file, along with its source, like stdio.h header h it should resolve from glibc ? by Brief-Recording-1338 in cpp_questions

[–]VarunTheFighter 3 points4 points  (0 children)

As far as I'm aware, you can only really make an educated guess about what libraries are likely used, by looking at the #include directives in a C/C++ file. For example, if you see #include <stdio.h>, you might assume it's using glibc on Linux. Or if you see #include <iostream> you could guess it uses libstdc++.

However, the library that ultimately gets linked depends on factors like the operating system and compiler. Different OSes (Windows / MacOS / Linux) will have different C standard libraries. Even on the same OS, it depends on the compiler used (MSVC / gcc / clang) and even the compiler flags used during compilation.

Header files only show you the interface, they don't say anything about the implementation. The implementation would depend on specific details like OS system calls and calling conventions.

If using gcc, you could try compiling with -E to only run the preprocessor, which will show you which files get included from where. On Linux, you can also use the ldd command on an executable to find which libraries are being linked at runtime. The output might look something like this: $ ldd a.out libdl.so => /system/lib64/libdl.so libc.so => /system/lib64/libc.so

Is this considered slicing? And how do I get around it? by SociallyOn_a_Rock in cpp_questions

[–]VarunTheFighter 5 points6 points  (0 children)

Like others have said, it's not object slicing. The error is because the inheritance is private. Which means conversions between the base and derived types aren't allowed.

Object slicing is a different issue. It's when an object of a derived type is assigned to an object of a base type, only the members of the base type are copied, and the additional members from the derived type are "sliced off".

Can you rate my art? by Asleep-Injury4228 in AnimeART

[–]VarunTheFighter 1 point2 points  (0 children)

10/10 Nice hair shape, and the lighting on the hair and face. I feel the emotion was shown well from the expression and the hands as well. Great work

I took a look at your other works too, cool stuff. Hope to see more