August 01, 2003
Generalized String Manipulation: Access Shims and Type Tunneling
Listing 2: Adaptive veneer: emulating standard string
Listing 2: Adaptive veneer: emulating standard string
template <typename S>
class c_str_veneer
: public S
, is_veneer<S, c_str_veneer<S> >
{
public:
typedef S parent_class_type;
typedef typename S::value_type value_type;
// Other methods, including constructors
...
value_type const *c_str() const;
};
template <>
inline LPCTSTR c_str_veneer<CString>::c_str() const
{
return *this;
}
Previous Page |
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
Next Page