Boost logo

Boost Users :

Subject: [Boost-users] Optionally enforce const correctness in argument dependent lookup
From: er (erwann.rogard_at_[hidden])
Date: 2009-01-17 23:24:05


Hi All,

The example below illustrates my intent, but obviously it's not the
right approach... so I'm hoping someone has a suggestion.

template<typename X>
struct enforce_constness{ typedef add_reference<const X> type; };

template<template<typename> class T = enforce_constness>
struct A{

  template<typename X>
  void operator()(typename T<X>::type x)const{
          // Under default I'd like const X&
  };

}

X x; A<> a; a(x);

no match for call to (A<T>)(X&)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net