Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-03-02 23:09:28


> namespace testns
> {
>
> struct Test
> {
> Test(std::string const& s_) : s(s_) {}
>
> bool operator==(Test const& t) const
> {
> return s==t.s;
> }
>
> std::string s;
> };
>
> namespace
> {
>
> std::ostream& operator<<(std::ostream& o, Test const& t)
> {
> return o<<t.s;
> }
>
> void free_test_function()
> {
> Test t1("test1"), t2("test2");
> BOOST_CHECK_EQUAL(t1, t2);
> }
>
> } //namespace
>
> } //namespace testns

Why do you need unnamed namespace? Remove it and it will all work.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net