Minor tweaks for consistency with coding style

This commit is contained in:
Tristan Penman 2016-08-10 08:22:06 -07:00
parent 3d3f76df10
commit 29721d5538
15 changed files with 56 additions and 49 deletions

View File

@ -210,7 +210,7 @@ int main(int argc, char *argv[])
while (results.popError(error)) {
cerr << "Error #" << errorNum << std::endl;
cerr << " ";
for( const std::string contextElement : error.context ) {
for (const std::string &contextElement : error.context) {
cerr << contextElement << " ";
}
cerr << endl;

View File

@ -30,10 +30,20 @@ namespace adapters {
template<class Value>
struct DerefProxy
{
explicit DerefProxy(const Value& x) : m_ref(x) {}
Value* operator->() { return std::addressof(m_ref); }
operator Value*() { return std::addressof(m_ref); }
explicit DerefProxy(const Value& x)
: m_ref(x) { }
Value* operator->()
{
return std::addressof(m_ref);
}
operator Value*()
{
return std::addressof(m_ref);
}
private:
Value m_ref;
};

View File

@ -193,8 +193,7 @@ public:
template<typename FunctorType>
void applyToPropertyDependencies(const FunctorType &fn) const
{
for( const PropertyDependencies::value_type &v :
propertyDependencies ) {
for (const PropertyDependencies::value_type &v : propertyDependencies) {
if (!fn(v.first, v.second)) {
return;
}
@ -204,8 +203,7 @@ public:
template<typename FunctorType>
void applyToSchemaDependencies(const FunctorType &fn) const
{
for( const SchemaDependencies::value_type &v :
schemaDependencies ) {
for (const SchemaDependencies::value_type &v : schemaDependencies) {
if (!fn(v.first, v.second)) {
return;
}

View File

@ -29,7 +29,6 @@ namespace json_pointer {
* @param search string to search
* @param replace replacement string
*/
inline void replace_all_inplace(std::string& subject, const char* search,
const char* replace)
{