Boost logo

Boost :

Subject: Re: [boost] Workaround for compiler bugs
From: Eric Niebler (eric_at_[hidden])
Date: 2010-12-06 17:02:41


On 12/6/2010 4:38 PM, Edward Diener wrote:
> The error report to Microsoft is at
> https://connect.microsoft.com/VisualStudio/feedback/details/624757/incorrect-function-template-deduction-involving-pointor-to-member-data

The only thing that bug report says is:

> An attempt to choose correctly between two function templates when
> calling a function fails when one of the function templates takes a
> pointer to member data and the data has an aggregate type.

In my experience, that's FAR too little information for them to actually
use. For instance, this program would seem to satisfy your description,
and yet VC10 compiles it just fine.

  struct S { int i; };

  template<class T>
  void foo( int S::* ) {}

  template<class T>
  void foo( T * ) {}

  int main() {
    foo( (char*)0 );
  }

You should always attach a repro to your bug reports.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk