Skip to content

clang-format 0.11-devel #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 6, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
clang-format -i find . -name "*.*pp"
  • Loading branch information
deanberris committed Sep 6, 2014
commit 5a75c1420ffd8dd5fee7df88302aa919cf987b2f
15 changes: 10 additions & 5 deletions boost/mime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class mime_parsing_error : public std::runtime_error {
: std::runtime_error(msg) {}
};

template <class traits> class basic_mime;
template <class traits>
class basic_mime;

namespace detail {

Expand All @@ -53,7 +54,8 @@ struct default_types {
typedef std::vector<char> body_type;
};

template <typename string_type> struct find_mime_header {
template <typename string_type>
struct find_mime_header {
find_mime_header(const char *str) : searchFor(str) {}
bool operator()(const std::pair<std::string, string_type> &val) const {
return boost::iequals(val.first, searchFor);
Expand Down Expand Up @@ -249,7 +251,8 @@ std::string get_boundary(const std::string &ctString) {
typedef std::vector<char> sub_part_t;
typedef std::vector<sub_part_t> sub_parts_t;

template <typename bodyContainer> struct multipart_body_type {
template <typename bodyContainer>
struct multipart_body_type {
bool prolog_is_missing;
bodyContainer body_prolog;
sub_parts_t sub_parts;
Expand Down Expand Up @@ -375,7 +378,8 @@ static boost::shared_ptr<basic_mime<traits> > parse_mime(
const char *default_content_type = "text/plain");
}

template <class traits = detail::default_types> class basic_mime {
template <class traits = detail::default_types>
class basic_mime {
public:
typedef enum {
simple_part,
Expand Down Expand Up @@ -570,7 +574,8 @@ template <class traits = detail::default_types> class basic_mime {

std::size_t body_size() const { return m_body->size(); }

template <typename Iterator> void set_body(Iterator begin, Iterator end) {
template <typename Iterator>
void set_body(Iterator begin, Iterator end) {
bodyContainer temp;
std::copy(begin, end, std::back_inserter(temp));
m_body->swap(temp);
Expand Down
6 changes: 4 additions & 2 deletions boost/network/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace boost {
namespace network {

namespace impl {
template <class Tag> struct constants_narrow {
template <class Tag>
struct constants_narrow {

static char const* crlf() {
static char crlf_[] = {'\r', '\n', 0};
Expand Down Expand Up @@ -115,7 +116,8 @@ template <class Tag> struct constants_narrow {
}
};

template <class Tag> struct constants_wide {
template <class Tag>
struct constants_wide {

static wchar_t const* https() {
static wchar_t https_[] = L"https";
Expand Down
3 changes: 2 additions & 1 deletion boost/network/detail/directive_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace boost {
namespace network {
namespace detail {

template <class Tag> struct directive_base {
template <class Tag>
struct directive_base {
typedef Tag tag;
// explicit directive_base(basic_message<tag> & message_)
// : _message(message_)
Expand Down
6 changes: 4 additions & 2 deletions boost/network/detail/wrapper_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace network {

namespace detail {

template <class Tag, class Message> struct wrapper_base {
template <class Tag, class Message>
struct wrapper_base {
explicit wrapper_base(Message& message_) : _message(message_) {};

protected:
Expand All @@ -21,7 +22,8 @@ template <class Tag, class Message> struct wrapper_base {
Message& _message;
};

template <class Tag, class Message> struct wrapper_base_const {
template <class Tag, class Message>
struct wrapper_base_const {
explicit wrapper_base_const(Message const& message_) : _message(message_) {}

protected:
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ namespace network {

/** The common message type.
*/
template <class Tag> struct basic_message {
template <class Tag>
struct basic_message {
public:
typedef Tag tag;

Expand Down
6 changes: 4 additions & 2 deletions boost/network/message/directives/detail/string_directive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

#ifndef BOOST_NETWORK_STRING_DIRECTIVE
#define BOOST_NETWORK_STRING_DIRECTIVE(name, value, body, pod_body) \
template <class ValueType> struct name##_directive { \
template <class ValueType> \
struct name##_directive { \
ValueType const& value; \
explicit name##_directive(ValueType const& value_) : value(value_) {} \
name##_directive(name##_directive const& other) : value(other.value) {} \
Expand All @@ -48,7 +49,8 @@
} \
}; \
\
template <class T> inline name##_directive<T> name(T const& input) { \
template <class T> \
inline name##_directive<T> name(T const& input) { \
return name##_directive<T>(input); \
}
#endif /* BOOST_NETWORK_STRING_DIRECTIVE */
Expand Down
12 changes: 8 additions & 4 deletions boost/network/message/directives/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ namespace network {

namespace impl {

template <class KeyType, class ValueType> struct header_directive {
template <class KeyType, class ValueType>
struct header_directive {

explicit header_directive(KeyType const& header_name,
ValueType const& header_value)
: _header_name(header_name), _header_value(header_value) {};

template <class Message> struct pod_directive {
template <class Message>
struct pod_directive {
template <class T1, class T2>
static void eval(Message const& message, T1 const& key, T2 const& value) {
typedef typename Message::headers_container_type::value_type value_type;
Expand All @@ -37,7 +39,8 @@ template <class KeyType, class ValueType> struct header_directive {
}
};

template <class Message> struct normal_directive {
template <class Message>
struct normal_directive {
template <class T1, class T2>
static void eval(Message const& message, T1 const& key, T2 const& value) {
typedef typename Message::headers_container_type::value_type value_type;
Expand All @@ -50,7 +53,8 @@ template <class KeyType, class ValueType> struct header_directive {
: mpl::if_<is_base_of<tags::pod, typename Message::tag>,
pod_directive<Message>, normal_directive<Message> >::type {};

template <class Message> void operator()(Message const& msg) const {
template <class Message>
void operator()(Message const& msg) const {
typedef typename Message::headers_container_type::value_type value_type;
directive_impl<Message>::eval(msg, _header_name, _header_value);
}
Expand Down
6 changes: 4 additions & 2 deletions boost/network/message/directives/remove_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
namespace boost {
namespace network {

template <class Tag> struct basic_message;
template <class Tag>
struct basic_message;

namespace impl {
template <class T> struct remove_header_directive {
template <class T>
struct remove_header_directive {

explicit remove_header_directive(T header_name)
: header_name_(header_name) {};
Expand Down
6 changes: 4 additions & 2 deletions boost/network/message/modifiers/remove_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ remove_header(Message& message, KeyType const& key, Tag) {
message.remove_header(key);
}

template <class KeyType> struct iequals_pred {
template <class KeyType>
struct iequals_pred {
KeyType const& key;
iequals_pred(KeyType const& key) : key(key) {}
template <class Header> bool operator()(Header& other) const {
template <class Header>
bool operator()(Header& other) const {
return boost::iequals(key, name(other));
}
};
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/traits/body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace network {

namespace traits {

template <class Tag> struct unsupported_tag;
template <class Tag>
struct unsupported_tag;

template <class Message>
struct body
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/traits/destination.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace network {

namespace traits {

template <class Tag> struct unsupported_tag;
template <class Tag>
struct unsupported_tag;

template <class Message>
struct destination
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/traits/headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace network {

namespace traits {

template <class Tag> struct unsupported_tag;
template <class Tag>
struct unsupported_tag;

template <class Message>
struct header_key
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/traits/source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ namespace network {

namespace traits {

template <class Tag> struct unsupported_tag;
template <class Tag>
struct unsupported_tag;

template <class Message>
struct source
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/transformers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
namespace boost {
namespace network {
namespace impl {
template <class Algorithm, class Selector> struct get_real_algorithm {
template <class Algorithm, class Selector>
struct get_real_algorithm {
typedef typename boost::function_traits<
typename boost::remove_pointer<Algorithm>::type>::result_type::
template type<typename boost::function_traits<
Expand Down
15 changes: 10 additions & 5 deletions boost/network/message/transformers/to_lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ namespace network {

namespace impl {

template <class Selector> struct to_lower_transformer {};
template <class Selector>
struct to_lower_transformer {};

template <> struct to_lower_transformer<selectors::source_selector> {
template <class Tag> void operator()(basic_message<Tag> &message_) const {
template <>
struct to_lower_transformer<selectors::source_selector> {
template <class Tag>
void operator()(basic_message<Tag> &message_) const {
boost::to_lower(message_.source());
}

protected:
~to_lower_transformer() {}
};

template <> struct to_lower_transformer<selectors::destination_selector> {
template <class Tag> void operator()(basic_message<Tag> &message_) const {
template <>
struct to_lower_transformer<selectors::destination_selector> {
template <class Tag>
void operator()(basic_message<Tag> &message_) const {
boost::to_lower(message_.destination());
}

Expand Down
15 changes: 10 additions & 5 deletions boost/network/message/transformers/to_upper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ namespace network {

namespace impl {

template <class Selector> struct to_upper_transformer {};
template <class Selector>
struct to_upper_transformer {};

template <> struct to_upper_transformer<selectors::source_selector> {
template <class Tag> void operator()(basic_message<Tag> &message_) const {
template <>
struct to_upper_transformer<selectors::source_selector> {
template <class Tag>
void operator()(basic_message<Tag> &message_) const {
boost::to_upper(message_.source());
}

protected:
~to_upper_transformer() {};
};

template <> struct to_upper_transformer<selectors::destination_selector> {
template <class Tag> void operator()(basic_message<Tag> &message_) const {
template <>
struct to_upper_transformer<selectors::destination_selector> {
template <class Tag>
void operator()(basic_message<Tag> &message_) const {
boost::to_upper(message_.destination());
}

Expand Down
3 changes: 2 additions & 1 deletion boost/network/message/wrappers/body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
namespace boost {
namespace network {

template <class Message> struct body_range {
template <class Message>
struct body_range {
typedef typename boost::iterator_range<
typename Message::string_type::const_iterator> type;
};
Expand Down
6 changes: 4 additions & 2 deletions boost/network/message/wrappers/headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ namespace boost {
namespace network {

/// Template metaprogram to get the range type for a message
template <class Message> struct headers_range {
template <class Message>
struct headers_range {
typedef typename headers_container<typename Message::tag>::type
headers_container_type;
typedef typename boost::iterator_range<
typename headers_container_type::const_iterator> type;
};

template <class Tag> struct basic_message;
template <class Tag>
struct basic_message;

/** headers wrapper for messages.
*
Expand Down
3 changes: 2 additions & 1 deletion boost/network/message_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
namespace boost {
namespace network {

template <class Tag> struct basic_message;
template <class Tag>
struct basic_message;

} // namespace boost
} // namespace network
Expand Down
9 changes: 6 additions & 3 deletions boost/network/protocol/http/algorithms/linearize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ namespace boost {
namespace network {
namespace http {

template <class Tag> struct linearize_header {
template <class Tag>
struct linearize_header {
typedef typename string<Tag>::type string_type;

template <class Arguments> struct result;
template <class Arguments>
struct result;

template <class This, class Arg> struct result<This(Arg)> {
template <class This, class Arg>
struct result<This(Arg)> {
typedef string_type type;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ struct http_async_protocol_handler {

struct to_http_headers {
typedef typename string<Tag>::type string_type;
template <class U> string_type const operator()(U const& pair) const {
template <class U>
string_type const operator()(U const& pair) const {
typedef typename ostringstream<Tag>::type ostringstream_type;
typedef constants<Tag> constants;
ostringstream_type header_line;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ struct ssl_delegate;

struct normal_delegate;

template <class Tag> struct connection_delegate_factory {
template <class Tag>
struct connection_delegate_factory {
typedef shared_ptr<connection_delegate> connection_delegate_ptr;
typedef typename string<Tag>::type string_type;

Expand Down
6 changes: 4 additions & 2 deletions boost/network/protocol/http/client/facade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ namespace boost {
namespace network {
namespace http {

template <class Tag> struct basic_request;
template <class Tag>
struct basic_request;

template <class Tag> struct basic_response;
template <class Tag>
struct basic_response;

template <class Tag, unsigned version_major, unsigned version_minor>
struct basic_client_facade {
Expand Down
Loading