Would you suggest doing this?

1
2
3
4
5
6
7
8
9
10
11
12
/*foo.h*/
int foo(int,int);
//...

/*Some other file*/
namespace foo_h{
    #include "foo.h"
}
//....
struct foo{
    //...
    int bar(){return foo_h::foo(10,573);}};

Is this legal, and would you suggest it? (Putting an external header in a namespace so I can redefine foo as a struct)
Last edited on
wouldn't be simpler to put the struct foo in a namespace?

C could be a pain.
The include will just copy-paste the content of foo.h, so I guess that you are putting it inside the namespace.
But what about the definitions?
1
2
3
4
5
/*Some other file.cpp*/
#include "Some other file.h"
namespace foo_h{
  #include "foo.cpp"
}
Last edited on
Topic archived. No new replies allowed.