473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Incorrect compiler diagnostic in VC++.NET 2005? (WAS: VC++.NET 2005 beta problem)

Vaclav

I have taken the liberty to cross-post this
microsoft.public.dotnet.languages.vc which has more visibility from
MSFT VC++ team.

thanks
--Dilip

Actual post by Vaclav Haisman originally posted at
comp.lang.c++.moderated follows:

================================================== ========================

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<Index> >
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<int> > it;
int index = it.index () - 1;

return 0;
}
Build log:
------ Build started: Project: test, Configuration: Debug Win32 ------
Compiling...
test.cpp
d:\WilX\VS.NET\test\test\test.cpp(57) : error C3861: 'IndexProxy':
identifier not found
d:\WilX\VS.NET\test\test\test.cpp(84) : see reference to
function
template instantiation
'indexing_iterator<Iterator,Index,IndexPolicy>::In dexProxy
operator -<int>(const
indexing_iterator<Iterator,Index,IndexPolicy>::Ind exProxy &,const U
&)'
being compiled
with
[
Iterator=std::_String_const_iterator<char,std::cha r_traits<char>,std::allocator<char>>,
Index=int,
IndexPolicy=default_index_policy<int>,
U=int
]
Build log was saved at
"file://d:\WilX\VS.NET\test\test\Debug\BuildLog.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! ]
Nov 17 '05 #1
0 1044

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ik | last post by:
Hello All, Can somebody tell, which compiler conforms C++ Standard, regarding templates better on Win32 Platform ? I was finding problems with VC++6.0 with some template code, but the same works...
21
by: JKop | last post by:
Today I wrote a function that returned an "std::ostringstream" by value. I compiled it with G++. It was throwing exceptions at run-time and closing. So I look through the code, and I look...
5
by: Mark | last post by:
The following code works with gnu compilers (ISO compliant declaration of the variable "i") void foo() { for (int i = 0; i < length; i++) { loop code.... } for (int i = 0; i < length; ...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
6
by: John Gabriel | last post by:
I have been obtaining the following error in the output window of the IDE: 1>mt.exe:general error c101008d:Failed to write the updated manifest to the resource of file "..\debug\test.exe". The...
1
by: Peted | last post by:
Hi, sorry if this isnt the correct newsgroups for this questions but im using vc++ 2005 express edition beta2 for learning to program vc++ ..net, as in winforms applications and i was wondering...
6
by: Russ | last post by:
This really is the worst Microsoft product I have ever had the misfortune to work with. After the excellent feattures and stability of VS.NET 2002 and 2003, I was confident enough to start a...
8
by: STG | last post by:
Greetings, My group has an SDK that was developed 5 years ago with VC++ 6. Over the last years, the requests for a VS.NET SDK has reached critical mass and I am now in the process of doing that....
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.