Listing 2: Embedded namespace implementation
// in stlsoft_frame_string.h
namespace stlsoft
{
template <...>
basic_frame_string
{
...
};
}
// in unixstl.h
namespace stlsoft
{
namespace unix_project
{
...
}
}
// Assigned here, because unixstl.h included by
// all other UNIXSTL files
namespace unixstl = stlsoft::unix_project;
// in unixstl_readdir_sequence.h
namespace stlsoft
{
namespace unix_project
{
class readdir_sequence
{
public:
typedef basic_frame_string< char
, NAME_MAX
> string_type;
...
};
}
}
// implementation file
int main(int argc, char **argv)
{
unixstl::readdir_sequence entries(argv[1]);
std::for_each(entries.begin(), entries.end(), ...);
...
}