Use anonymous namespaces instead of static functions. (More idomatic)
This commit is contained in:
parent
ebb20044d9
commit
ab685a66e7
|
@ -19,7 +19,9 @@ struct Options {
|
|||
};
|
||||
|
||||
|
||||
static Options parse_commandline(int argc, char** argv)
|
||||
namespace {
|
||||
|
||||
Options parse_commandline(int argc, char** argv)
|
||||
{
|
||||
Options options;
|
||||
bool show_help{};
|
||||
|
@ -40,6 +42,8 @@ static Options parse_commandline(int argc, char** argv)
|
|||
return options;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
|
@ -28,7 +28,9 @@ struct Options {
|
|||
};
|
||||
|
||||
|
||||
static Options parse_commandline(int argc, char** argv)
|
||||
namespace {
|
||||
|
||||
Options parse_commandline(int argc, char** argv)
|
||||
{
|
||||
Options options;
|
||||
bool show_help{};
|
||||
|
@ -49,7 +51,6 @@ static Options parse_commandline(int argc, char** argv)
|
|||
return options;
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& ostream, const rslp::Command& command)
|
||||
{
|
||||
using Type = rslp::Command_Data::DataCase;
|
||||
|
@ -91,7 +92,6 @@ std::ostream& operator<<(std::ostream& ostream, const rslp::Command& command)
|
|||
return ostream;
|
||||
}
|
||||
|
||||
|
||||
class ProtobufResplyClient {
|
||||
public:
|
||||
ProtobufResplyClient(const std::string& host, const std::string& port) :
|
||||
|
@ -189,6 +189,7 @@ private:
|
|||
asio::ip::tcp::socket socket_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
using resply::Result;
|
||||
|
||||
namespace {
|
||||
|
||||
enum RespTypes {
|
||||
SIMPLE_STRING = '+',
|
||||
ERROR = '-',
|
||||
|
@ -23,6 +25,8 @@ enum RespTypes {
|
|||
ARRAY = '*'
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool RespParser::parse(std::istream& stream)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,9 @@ struct Options {
|
|||
};
|
||||
|
||||
|
||||
static Options parse_commandline(int argc, char** argv)
|
||||
namespace {
|
||||
|
||||
Options parse_commandline(int argc, char** argv)
|
||||
{
|
||||
Options options;
|
||||
bool show_help{}, show_version{};
|
||||
|
@ -50,6 +52,8 @@ static Options parse_commandline(int argc, char** argv)
|
|||
return options;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
Reference in a new issue