~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to include/libtorrent/asio/placeholders.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2008-07-02 10:46:21 UTC
  • Revision ID: james.westby@ubuntu.com-20080702104621-jzx3pfke9lkcxfxn
Tags: upstream-0.13.1
ImportĀ upstreamĀ versionĀ 0.13.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// placeholders.hpp
 
3
// ~~~~~~~~~~~~~~~~
 
4
//
 
5
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
6
//
 
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
 
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
9
//
 
10
 
 
11
#ifndef ASIO_PLACEHOLDERS_HPP
 
12
#define ASIO_PLACEHOLDERS_HPP
 
13
 
 
14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
 
15
# pragma once
 
16
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
17
 
 
18
#include "asio/detail/push_options.hpp"
 
19
 
 
20
#include "asio/detail/push_options.hpp"
 
21
#include <boost/bind/arg.hpp>
 
22
#include <boost/detail/workaround.hpp>
 
23
#include "asio/detail/pop_options.hpp"
 
24
 
 
25
namespace asio {
 
26
namespace placeholders {
 
27
 
 
28
#if defined(GENERATING_DOCUMENTATION)
 
29
 
 
30
/// An argument placeholder, for use with boost::bind(), that corresponds to
 
31
/// the error argument of a handler for any of the asynchronous functions.
 
32
unspecified error;
 
33
 
 
34
/// An argument placeholder, for use with boost::bind(), that corresponds to
 
35
/// the bytes_transferred argument of a handler for asynchronous functions such
 
36
/// as asio::basic_stream_socket::async_write_some or
 
37
/// asio::async_write.
 
38
unspecified bytes_transferred;
 
39
 
 
40
/// An argument placeholder, for use with boost::bind(), that corresponds to
 
41
/// the iterator argument of a handler for asynchronous functions such as
 
42
/// asio::basic_resolver::resolve.
 
43
unspecified iterator;
 
44
 
 
45
#elif defined(__BORLANDC__) || defined(__GNUC__)
 
46
 
 
47
inline boost::arg<1> error()
 
48
{
 
49
  return boost::arg<1>();
 
50
}
 
51
 
 
52
inline boost::arg<2> bytes_transferred()
 
53
{
 
54
  return boost::arg<2>();
 
55
}
 
56
 
 
57
inline boost::arg<2> iterator()
 
58
{
 
59
  return boost::arg<2>();
 
60
}
 
61
 
 
62
#else
 
63
 
 
64
namespace detail
 
65
{
 
66
  template <int Number>
 
67
  struct placeholder
 
68
  {
 
69
    static boost::arg<Number>& get()
 
70
    {
 
71
      static boost::arg<Number> result;
 
72
      return result;
 
73
    }
 
74
  };
 
75
}
 
76
 
 
77
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
 
78
 
 
79
static boost::arg<1>& error
 
80
  = asio::placeholders::detail::placeholder<1>::get();
 
81
static boost::arg<2>& bytes_transferred
 
82
  = asio::placeholders::detail::placeholder<2>::get();
 
83
static boost::arg<2>& iterator
 
84
  = asio::placeholders::detail::placeholder<2>::get();
 
85
 
 
86
#else
 
87
 
 
88
namespace
 
89
{
 
90
  boost::arg<1>& error
 
91
    = asio::placeholders::detail::placeholder<1>::get();
 
92
  boost::arg<2>& bytes_transferred
 
93
    = asio::placeholders::detail::placeholder<2>::get();
 
94
  boost::arg<2>& iterator
 
95
    = asio::placeholders::detail::placeholder<2>::get();
 
96
} // namespace
 
97
 
 
98
#endif
 
99
 
 
100
#endif
 
101
 
 
102
} // namespace placeholders
 
103
} // namespace asio
 
104
 
 
105
#include "asio/detail/pop_options.hpp"
 
106
 
 
107
#endif // ASIO_PLACEHOLDERS_HPP