 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Vaclav Haisman Guest
|
Posted: Sat Sep 25, 2004 6:13 pm Post subject: VC++.NET 2005 beta problem |
|
|
I have this test case that VC++.NET 2005 beta refuses to compile. I think
that it is valid C++. If it is, is there a "bugzilla" for the compiler where
I could report it?
VH
#include <string>
#include <iterator>
template <typename T>
struct default_index_policy
{
typedef T index_type;
template <typename U>
index_type
minus_left (index_type const & t, U const & u) const
{
return t - u;
}
};
/////////////////////////////////////////////////////////////////
typedef size_t _default_index_type;
template <typename Iterator, typename Index = _default_index_type,
typename IndexPolicy = default_index_policy
class indexing_iterator
{
public:
typedef Iterator iterator_type;
typedef Index index_type;
typedef IndexPolicy index_policy_type;
class IndexProxy
{
protected:
index_type const idx;
index_policy_type const idx_policy;
public:
IndexProxy (index_type const & i, index_policy_type const & pol)
: idx (i), idx_policy (pol)
{ }
index_type index () const
{
return idx;
}
operator index_type () const
{
return idx;
}
// IndexProxy operators:
template <typename U>
friend IndexProxy
operator - (IndexProxy const & p, U const & u)
{
return IndexProxy (p.idx_policy.minus_left (p.index (), u),
p.idx_policy);
}
};
typedef IndexProxy index_proxy_type;
protected:
iterator_type current;
index_type idx;
index_policy_type idx_policy;
public:
indexing_iterator ()
{ }
index_proxy_type
index () const
{
return IndexProxy (idx, idx_policy);
}
};
///////////////////////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
indexing_iterator<std::string::const_iterator, int,
default_index_policy it;
int index = it.index () - 1;
return 0;
}
Build log:
------ Build started: Project: test, Configuration: Debug Win32 ------
Compiling...
test.cpp
d:WilXVS.NETtesttesttest.cpp(57) : error C3861: 'IndexProxy':
identifier not found
d:WilXVS.NETtesttesttest.cpp(84) : see reference to function
template instantiation
'indexing_iterator<Iterator,Index,IndexPolicy>::IndexProxy
operator -<int>(const
indexing_iterator<Iterator,Index,IndexPolicy>::IndexProxy &,const U &)'
being compiled
with
[
Iterator=std::_String_const_iterator<char,std::char_traits,
Index=int,
IndexPolicy=default_index_policy<int>,
U=int
]
Build log was saved at "file://d:WilXVS.NETtesttestDebugBuildLog.htm"
test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Sun Sep 26, 2004 9:59 am Post subject: Re: VC++.NET 2005 beta problem |
|
|
"Vaclav Haisman" <V.Haisman (AT) sh (DOT) cvut.cz> wrote...
| Quote: | I have this test case that VC++.NET 2005 beta refuses to compile. I think
that it is valid C++. If it is, is there a "bugzilla" for the compiler
where
I could report it?
[...]
|
I strongly recommend asking compiler-specific questions in a compiler-
specific newsgroups. This one is for 'microsoft.public.vc.language',
where you will undoubtedly find the URL for reporting 2005 beta bugs.
V
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|