Boost logo

Boost :

Subject: Re: [boost] Warning policy? local variable hides (i.e. shadows) global variable
From: Robert Ramey (ramey_at_[hidden])
Date: 2015-01-15 11:47:20

If you want to make it a "guideline" I would be OK with that. If you want to
make something stronger - I think that this would be a bad idea. The basic
problem is that this couples a derived class to it's parent(s) and a library
author doesn't always control it's parents: example:

template<typename T>
struct opaque_type : public T {
    const char *name = "...";

struct user_class : public opaque_type<T> {
   ... // user might really want to shadow
   const char *name = "asdfasdf";

This is a contrived example, so don't call me on this one. My real point is
that it's hard to predict the cases where a "hard rule" would be problem.

Robert Ramey

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at