$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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&)