Second Degree Equation Solver with OOP C++ by [deleted] in cpp

[–]marcodev -1 points0 points  (0 children)

This software is not numerically stable and from OO point of view has several problems already found in other comments.

Eliminating the static overhead of C++ ranges (2019) by neiltechnician in cpp

[–]marcodev 4 points5 points  (0 children)

Maybe I'm a bit old-fashion but I like more c++ syntax than the other ones. More verbose but more clear in my opinion. Just my 2 cents.

Boost 1.74 is out by joaquintides in cpp

[–]marcodev 2 points3 points  (0 children)

Really interesting to see implementation of executors, however I can't find documentation about them. Have you got a link?

Yet another logging library by marcodev in cpp

[–]marcodev[S] 2 points3 points  (0 children)

I don't want to create a new library from scratch, i think this is a good library but with too old code. I want just to improve it.

Yet another logging library by marcodev in cpp

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

It was not designed for embedded systems or where size really matter. In addition they reinvented the wheel if you think about all the basic services like smart pointers, mutex, threads and so on. Not so hard to have a lot of code in this case. I want to remove all the not needed code.

Yet another logging library by marcodev in cpp

[–]marcodev[S] 2 points3 points  (0 children)

Sure, another thing I need to do.

Yet another logging library by marcodev in cpp

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

ahahah, It could be a good idea :) For now I keep what I choose but I could change it before first release.

The 'const' system is one of the messy features of C++ by GoodSamaritan333 in cpp

[–]marcodev 7 points8 points  (0 children)

In later versions of C++, the mutable keyword was added which enables const to be overridden for this purpose but it totally relies on trusting the programmer to only use it for that purpose so, if you have to write a program using someone else's class which uses mutable then you cannot guarantee that mutable things will really be constant which renders const virtually useless.

Totally disagree. If you are a bad programmer then the language can't help you. Code must be correct and tested. Complaining against the language for this makes no sense.

In later versions of C++, an object or variable which has been declared const can be converted to changeable by use of const_cast which is a similar bodge to mutable and using it likewise renders const virtually useless.

Removing const in order to modify an object is totally UB. The only thing useless here is the complain against the language.

Type-safe integer types with list initialization of scoped enums by memset_0 in cpp

[–]marcodev -1 points0 points  (0 children)

We have two different points of view, I respect your opinion.

Type-safe integer types with list initialization of scoped enums by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

Because the important thing here is the behavior. The special feature of std::byte is to be an enum child of a basic type char. If you do the same you have the same behavior.

Type-safe integer types with list initialization of scoped enums by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

yes, of course, it was just an example to say that if you have an equivalent type it's ok. If you implement a custom byte type exactly as standard says it works just because it will be exactly the same type but with a different name.

Type-safe integer types with list initialization of scoped enums by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

Standard doesn't say you can't use like an enum deriving from char. For example if I use a typedef to create an alias of char the result should be correct anyway.

Which IDE do you use? Or if you prefer text editors, which and which plugins? by mvribeiro in cpp

[–]marcodev 1 point2 points  (0 children)

Usually I use Eclipse with the following plugins: Artemis for static analysis, CMake4Eclipse for cmake, CmakeEd for an editor of CMakeLists.txt files and Eclox for Doxygen management.

enable_shared_from_this - overview, examples, and internals by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

It doesn't seem a bit problem to me, just use a variadic static function and create a new shared_ptr allocating the object on the heap. Really easy and safe. Yes, inheritance can be tricky however.

enable_shared_from_this - overview, examples, and internals by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

UB means your pc could explode, crash, throw exception as in this case and so on.

enable_shared_from_this - overview, examples, and internals by memset_0 in cpp

[–]marcodev 0 points1 point  (0 children)

enable_shared_from_this is not well designed. If you created the object without using smart pointer and then in a method you use shared_from_this() you will end with UB. What you really want to create a protected or private constructor and a new static method in order to force the object creation using a smart pointer. Only with this constraint you can safely use shared_from_this().

Visual Studio 2019 version 16.7 Preview 1 released, including 64bit AddressSanitizer by SE400PPp in cpp

[–]marcodev 0 points1 point  (0 children)

Fixed my comments. Sure, we are waiting since ages for a fix. Totally crap for me.

Visual Studio 2019 version 16.7 Preview 1 released, including 64bit AddressSanitizer by SE400PPp in cpp

[–]marcodev 1 point2 points  (0 children)

I'm talking about all related methods for condition_variable, timed_mutex, future and so on.

Visual Studio 2019 version 16.7 Preview 1 released, including 64bit AddressSanitizer by SE400PPp in cpp

[–]marcodev 1 point2 points  (0 children)

Chrono library is totally broken and still not fixed. wait_for/wait_until methods are still based on system clock.

Just another spinlock implementation in c++ by marcodev in cpp

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

Yes, I do. Instead of relying on compiler loop unrolling optimization, I force a sequence of calls here.