monotone

monotone Mtn Source Tree

Root/src/lexical_cast.hh

1// Copyright (C) 2007 Timothy Brownawell <tbrownaw@gmail.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#ifndef __LEXICAL_CAST_HH__
11#define __LEXICAL_CAST_HH__
12
13#include <boost/lexical_cast.hpp>
14
15// Generic lexical_cast can be a bit slow sometimes. If a particular
16// version shows up in profiles, consider writing a specialization.
17// Note: because we do this, every file that uses boost::lexical_cast
18// _must_ include this file instead of <boost/lexical_cast.hpp>, or we
19// risk violating the One Definition Rule (if some file instantiates
20// the generic template for the types we specialize here). This is not
21// a theoretical problem; the Windows linker will fail.
22
23namespace boost {
24 template<>
25 std::string lexical_cast<std::string, unsigned int>(unsigned int const & _i);
26
27 template<>
28 unsigned int lexical_cast<unsigned int, std::string>(std::string const & s);
29
30}
31
32#endif
33
34// Local Variables:
35// mode: C++
36// fill-column: 76
37// c-file-style: "gnu"
38// indent-tabs-mode: nil
39// End:
40// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status