1////////////////////////////////////////////////////////////////////////////////
2
3//   Author:    Andy Rushton
4//   Copyright: (c) Southampton University 1999-2004
5//              (c) Andy Rushton           2004 onwards
6//   License:   BSD License, see ../docs/license.html
7
8////////////////////////////////////////////////////////////////////////////////
9#include <string>
10
11namespace stlplus
12{
13
14  template <typename T, typename S>
15  void print_pointer(std::ostream& device,
16                     const T* value,
17                     S print_fn,
18                     const std::string& null_string,
19                     const std::string& prefix,
20                     const std::string& suffix)
21  {
22    if (value)
23    {
24      device << prefix;
25      print_fn(device, *value);
26      device << suffix;
27    }
28    else
29    {
30      device << null_string;
31    }
32  }
33
34} // end namespace stlplus
35