[ 
https://issues.apache.org/jira/browse/MESOS-2705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587888#comment-14587888
 ] 

Michael Park commented on MESOS-2705:
-------------------------------------

Looked into this a little bit, and I'm shocked at how inconsistent this style 
is at least in the places I looked.

The [latest draft of the 
standard|http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4431.pdf] has 
1545 occurrences of {{template<}} and 2252 occurrences of {{template <}}.

The LLVM codebase has 785 occurrences of {{template<}} and 2573 occurrences of 
{{template <}}.

The Clang codebase has 9120 occurrences of {{template<}} and 4541 occurrences 
of {{template <}}.

In Mesos, we've got 19 occurrences of {{template<}} and 738 occurrences of 
{{template <}}.

So I'm not sure that "most code omits this space" is true, it seems to me like 
most codebases don't actually care. Having said that, I think arguments can be 
made in favor of either side. I would say let's go with what {{clang-format}} 
does, which is {{template <}}.

> Add correct format template declarations to the styleguide
> ----------------------------------------------------------
>
>                 Key: MESOS-2705
>                 URL: https://issues.apache.org/jira/browse/MESOS-2705
>             Project: Mesos
>          Issue Type: Documentation
>            Reporter: Alexander Rojas
>            Assignee: Alexander Rojas
>
> The general rule to format templates is to declare them as:
> {code}
> template <typename T> // notice the space between template and <
> class Foo {
>   …
> };
> {code}
> However, the style is not documented anywhere nor it is inherited from the 
> Google style guide.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to