Skip to content

Commit

Permalink
Work around bug in VS2015
Browse files Browse the repository at this point in the history
There seems to be a bug in Visual Studio 2015 that leads to a call tp
logger_impl::set_stream instead of standard_logger_impl::set_stream in
the "basic logging support" test case, which throws a "not supported"
exception instead of actually setting the log stream, leading to a test
case failure. This hasn't been observed for any other compiler,
including more recent versions of Visual Studio. Thus, it was concluded
that this was indeed a compiler bug in VS2015.

Moving the standard_logger_impl implementation out of the anonymous
namespace works around this bug without affecting the behavior of the
library in any way.
  • Loading branch information
Krzmbrzl committed Sep 1, 2024
1 parent 6b6db13 commit efe3a05
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/core/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
using namespace soci;
using namespace soci::details;

namespace // anonymous
{

void ensureConnected(session_backend * backEnd)
{
if (backEnd == NULL)
Expand Down Expand Up @@ -70,8 +67,6 @@ class standard_logger_impl : public logger_impl
std::string lastQuery_;
};

} // namespace anonymous

session::session()
: once(this), prepare(this),
logger_(new standard_logger_impl),
Expand Down

0 comments on commit efe3a05

Please sign in to comment.