Thanks to visit codestin.com
Credit goes to github.com

Skip to content

using namespace linalg::ostream_overloads sometimes does not work. #30

@mirmik

Description

@mirmik

using namespace linalg::ostream_overloads sometimes does not work as planed.
For example doctest library(https://github.com/onqtam/doctest) does not found operator defined like this.

It might be a good idea to change it in the documentation for this way:

#include "linalg.h"
namespace linalg { using linalg::ostream_overloads::operator <<; }

It works better because c++ adl mechanism lookup function in argument`s namespaces first. So, in other places it can ignore overloaded operator for various reasons.

(In fact, it's not entirely clear to me why the overloads are generally hidden. )

Thanks for your work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions