earthwormgaz wrote:
I am trying to add the headers for a library I am using to a namespace
to avert issues with name clashes.
namespace Lib
{
#include <Lib/SomeFile.h>
};
I am finding though that statements to the following effect in that
code are then broken ...
using std::size_t;
The compiler complains that it doesn't know about size_t, I presume
that is because it only knows about Lib::std::size_t.
Most likely, SomeFile.h #includes a header from the standard library. If
you #include a standard library header inside a namespace the behavior
of the program is undefined, precisely because of this sort of problem.
But even if you dodge around the problems this causes for the standard
library, there's a good chance that the other library you're using won't
work right, because it wasn't compiled with its names inside your namespace.
--
-- Pete
Roundhouse Consulting, Ltd. (
www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (
www.petebecker.com/tr1book)