Roy
nullptr
whaat?
Igor🇺🇦
Roy
you return an empty shared ptr that is stored as static.
ohh my! good idea, take all my candy, really
Alex
https://pastebin.com/vmwvNEkR
what is the point to use auto as return type and -> void for example?
Alex
only for pretty design
why do you consider it pretty?
Alex
this code is harder to read. it seems to me its not the only one issue
Igor🇺🇦
why do you consider it pretty?
IMHO it's just harder to read and more typing.
Alex
you are trying to write sexy code, you should make your code easy to read
Roy
Hard read but sexy for use
Alex
without overengineering such as templates and shared_ptr on every step
Alex
Hard read but sexy for use
I hope you will not code for money
Alex
You will not understand why this is needed
of course, I do not write sexy code
Roy
of course, I do not write sexy code
no, you not write mmo backend
Roy
It is more profitable to store shared_ptr than to call 1 million find in your hash map
Roy
if you iterate 1m entity
Alex
static vars inside functions, auto , templates, shared_ptr everywhere.. awful code
Alex
variable template argument, you are cool bro :)
Alex
hope to not deal with this type of code in my life
Alex
you are junior, who wants to show his knowledge of c++ to the world
Roy
static vars inside functions, auto , templates, shared_ptr everywhere.. awful code
you think the compiler generates as many static variables as you have template functions?
Hadaward 'Solly'
Pavel
no, you not write mmo backend
wonder how it's related usually game dev programmers are the most conservative ones and don't accept new fancy syntax unless it proven to be more effective :D
Alex
you think the compiler generates as many static variables as you have template functions?
I think non const static vars inside func is bad practice at all. cause your code does not work with multi threads, and harder to debug and write unit tests because of state
Igor🇺🇦
In the https://pastebin.com/vmwvNEkR, what's the purpose of ~ResourceManager() = delete; ?
Roy
All of your component data is stored in a Ctx instance, as context objects
Roy
In github have architecture image
Pavel
All components in my framework it's only static classes
I wonder why you didn't make ResourceManager a template instead of templating every its member or not replace it with namespace
Roy
I wonder why you didn't make ResourceManager a template instead of templating every its member or not replace it with namespace
ResourceManager - it's component, he use Storage<Type> for push your type resources in hash map
Roy
In games, some files use the same type, but there can be many instances of them Example items
Igor🇺🇦
All components in my framework it's only static classes
But why deleting destructor? How does this help? If you want to prevent others to create object of this type you can make constructor private.
Roy
But why deleting destructor? How does this help? If you want to prevent others to create object of this type you can make constructor private.
And what does C++ forbid to specify delete for destructors? I could just specify delete for the destructor and erase the rest of the constructors, but I just like to be more detailed
Roy
Sorry, I didn't understand. What are you trying to achieve?
nothing, just comfortable user space design, across boundary indexes and shared memory for all objects
Pavel
But why deleting destructor? How does this help? If you want to prevent others to create object of this type you can make constructor private.
I think it's not a bad idea to mark destructor as deleted just as a matter of precaution and following the rule of 5 I don't get the idea of non-constructable class, but that's another thing
Igor🇺🇦
the only thing you can do with this class is call new and never call delete. Why would I want that?
Pavel
the only thing you can do with this class is call new and never call delete. Why would I want that?
you can't call new also, the only constructor is deleted. you can't instantiate the class in any way
Roy
If your dtor deleted you cannot create object
Igor🇺🇦
To prevent the creation of class objects
you can, if you have any constructor. Why do you need such class that you cannot instantiate?
Pavel
I mean in general - why there is a need in deleted destructor?
There's no real need as the only constor is deleted, but as a matter of precaution (if you accidentally introduce another constructor) and to follow the rule of 5 it can be declared like this also.
Igor🇺🇦
I can only think of tag dispatching or something like that. But then why do you need to declare these methods at al?
Pavel
What can happen if you do have a default destructor?
I don't understand the question. Nothing? What can happen if you don't have it?
Igor🇺🇦
I don't understand the question. Nothing? What can happen if you don't have it?
Why C++ allows deleting destructors?, What's the point of such classes?
Roy
Just give user pretty namespace
Alex
Just give user pretty namespace
why using namespace keyword is not sexy ?
Igor🇺🇦
It's not creatable class
Why do you need such class? And again - deleting destructor doesn't prevent from creating an object of such class.
Roy
why using namespace keyword is not sexy ?
I didn't say it, I just wanted it that way
Alex
Why do you need such class? And again - deleting destructor doesn't prevent from creating an object of such class.
I think every created object should be deleted by calling destructor. so this is compilation error
Igor🇺🇦
Alex
you can create it on a heap with new and never delete it .
yeah, but this is initially wrong approach. anyway I don`t understand why to delete dtor also. it seems to me Roy is deviant coder, who uses class as namespace etc
Vlad
you can create it on a heap with new and never delete it .
placement new on a stack buffer. Next level of shiz
Roy
placement new on a stack buffer. Next level of shiz
It's good idea, use stack flat buffer and after use placement new for push objects by offset (joke... or not?)
Roy
ohh yea, i'm forgot, if you use classes you can hide your context's from user and other struct's of impl
Roy
I prefer to spend more memory if it improves performance, memory is cheaper these days
Roy
so I often use type indexing and static to avoid calling .find twice
Roy
© chromium team
© C++ pervent team
Roy
Vlad
wtf is the "pervent"?
Alex
wtf is the "pervent"?
probably he wants to use " pervert"
Vlad
probably he wants to use " pervert"
probably but he's spelling like he's got a sting up his ass
Alex
probably but he's spelling like he's got a sting up his ass
yeah, interesting guy, better to not work with him at all
Alex
code hard to read and support
Igor🇺🇦
ohh yea, i'm forgot, if you use classes you can hide your context's from user and other struct's of impl
I didn't understand what you can do with classes that you cannot create that you can't do with namespaces.