[
https://issues.apache.org/jira/browse/MESOS-2564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14388362#comment-14388362
]
Alexander Rukletsov commented on MESOS-2564:
--------------------------------------------
I see. I think the intention of having a "named section for forward
declarations" is not clear enough to folks (at least is wasn't clear to me).
Some examples of what we have in reality:
{code}
// From slave.hpp
class MasterDetector; // Forward declaration.
namespace slave {
using namespace process;
// Some forward declarations.
class StatusUpdateManager;
struct Executor;
struct Framework;
{code}
{code}
// From master.hpp
namespace process {
class RateLimiter; // Forward declaration.
}
namespace mesos {
namespace internal {
// Forward declarations.
namespace registry {
class Slaves;
}
class Authorizer;
class WhitelistWatcher;
namespace master {
class Repairer;
class SlaveObserver;
struct BoundedRateLimiter;
struct Framework;
struct Role;
struct Slave;
{code}
{code}
// From slave/containerizer/launcher.cpp
... <some definitions> ...
140: // Forward declaration.
141: Future<Nothing> _destroy(const Future<Option<int>>& future);
{code}
Keeping forward declarations at the top of the file is not always possible,
consider the case of nested namespaces. I would propose we kill this comment
and introduce a note in our style that we put forward declarations at the top
of the namespace. Does it make sense?
> Kill superfluous forward declaration comments.
> ----------------------------------------------
>
> Key: MESOS-2564
> URL: https://issues.apache.org/jira/browse/MESOS-2564
> Project: Mesos
> Issue Type: Improvement
> Reporter: Alexander Rukletsov
> Priority: Minor
> Labels: easyfix, newbie
>
> We often prepend forward declarations with a comment, which is pretty
> useless, e.g.:
> {code}
> // Forward declarations.
> class LogStorageProcess;
> {code}
> or
> {code}
> // Forward declarations.
> namespace registry {
> class Slaves;
> }
> class Authorizer;
> class WhitelistWatcher;
> {code}
> This JIRA aims to clean up such comments.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)