ft_containers_monkey_tester icon indicating copy to clipboard operation
ft_containers_monkey_tester copied to clipboard

Error related to `logger.hpp` when executing tester

Open nicolasgasco opened this issue 2 years ago • 1 comments

Hi! I'm trying to execute your tester on an M1 MacBook Pro, but, as soon as I run e.g. sh monkey.sh vector, I get a bunch of errors related to logger.hpp. It's a very long output, this is only part of it:

🐒 compiling std... 
In file included from srcs/main.cpp:6:
In file included from srcs/test_vector.hpp:7:
srcs/logger.hpp:171:77: error: non-const lvalue reference to type 'basic_ostringstream<...>' cannot bind to a temporary of type 'basic_ostringstream<...>'
                this->log<NONE>("[GDB]===================================> br log.cpp:" + SSTR(this->line + 1));
                                                                                          ^~~~~~~~~~~~~~~~~~~~
srcs/logger.hpp:21:21: note: expanded from macro 'SSTR'
# define SSTR( x ) (static_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << (x) ) ).str())
                    ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from srcs/main.cpp:6:
srcs/test_vector.hpp:92:44: error: non-const lvalue reference to type 'basic_ostringstream<...>' cannot bind to a temporary of type 'basic_ostringstream<...>'
                                logger.log<logger::CPP>(n1 + " = C(" + SSTR(rand) + ", \"" + val + "\");");
                                                                       ^~~~~~~~~~
srcs/logger.hpp:21:21: note: expanded from macro 'SSTR'
# define SSTR( x ) (static_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << (x) ) ).str())
                    ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from srcs/main.cpp:6:
srcs/test_vector.hpp:116:47: error: non-const lvalue reference to type 'basic_ostringstream<...>' cannot bind to a temporary of type 'basic_ostringstream<...>'
                                logger.log<logger::CPP>(n1 + ".assign(" + SSTR(rand) + ", \"" + val + "\");");
                                                                          ^~~~~~~~~~
srcs/logger.hpp:21:21: note: expanded from macro 'SSTR'
# define SSTR( x ) (static_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << (x) ) ).str())
                    ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from srcs/main.cpp:6:
srcs/test_vector.hpp:144:43: error: non-const lvalue reference to type 'basic_ostringstream<...>' cannot bind to a temporary of type 'basic_ostringstream<...>'
                                        logger.log<logger::CPP>(n1 +".at(" + SSTR(rand) + " % " + n1 + ".size()) = \"" + SSTR(val) + "\";");
                                                                             ^~~~~~~~~~
srcs/logger.hpp:21:21: note: expanded from macro 'SSTR'
# define SSTR( x ) (static_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << (x) ) ).str())
                    ^                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from srcs/main.cpp:6:
srcs/test_vector.hpp:150:48: error: non-const lvalue reference to type 'basic_ostringstream<...>' cannot bind to a temporary of type 'basic_ostringstream<...>'
                                        logger.log<logger::CPP_LOG>(n2 + ".at(" + SSTR(rand) + " % " + n2 +".size())");
                                                                                  ^~~~~~~~~~

Am I doing something wrong?

Thank you

nicolasgasco avatar Dec 09 '22 21:12 nicolasgasco