473,607 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Vaclav

I have taken the liberty to cross-post this
microsoft.publi c.dotnet.langua ges.vc which has more visibility from
MSFT VC++ team.

thanks
--Dilip

Actual post by Vaclav Haisman originally posted at
comp.lang.c++.m oderated 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_p olicy
{
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_p olicy<Index> >
class indexing_iterat or
{
public:
typedef Iterator iterator_type;
typedef Index index_type;
typedef IndexPolicy index_policy_ty pe;

class IndexProxy
{
protected:
index_type const idx;
index_policy_ty pe const idx_policy;

public:
IndexProxy (index_type const & i, index_policy_ty pe 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.m inus_left (p.index (),
u),
p.idx_policy);
}
};

typedef IndexProxy index_proxy_typ e;

protected:
iterator_type current;
index_type idx;
index_policy_ty pe idx_policy;

public:
indexing_iterat or ()
{ }

index_proxy_typ e
index () const
{
return IndexProxy (idx, idx_policy);
}
};

///////////////////////////////////////////////////////////////////////////////////

int main(int argc, char* argv[])
{
indexing_iterat or<std::string: :const_iterator , int,
default_index_p olicy<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_itera tor<Iterator,In dex,IndexPolicy >::IndexProxy
operator -<int>(const
indexing_iterat or<Iterator,Ind ex,IndexPolicy> ::IndexProxy &,const U
&)'
being compiled
with
[
Iterator=std::_ String_const_it erator<char,std ::char_traits<c har>,std::alloc ator<char>>,
Index=int,
IndexPolicy=def ault_index_poli cy<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++.m oderated. First time posters: Do this! ]
Nov 17 '05 #1
0 1060

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

Similar topics

6
2146
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 fine with Digital Mars and Gcc. Is there any comparison available regarding templates for these compilers ? Any help will be appreciated. Thanks IK
21
1944
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 and I look... I forgot to put in the return statement in the aforementioned funtion, ie. it had no return statement.
5
3831
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; i++) {
16
2841
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...) Oh, I forgot to list the error messages; I would be delighted if someone could explain how to deduce which line number in which file is the one that the VC compiler cannot handle. Actually I'm using C#, but the only post I could find about...
6
5003
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 process cannot access the file because it is being used by another process. 1>Project : error PRJ0002 : Error result 31 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\mt.exe'. 1>Build log was saved at...
1
1762
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 if can anyone point me to some sample code for writing to connect to a existing telnet server I just want to be able to establish a connection, send character info and retreive the result sent back as a result of what i send.
6
1551
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 major project in beta 2 of VS 2005. But as I began to use the Beta I had major concerns about the product and every subsequent CTP and the RC did nothing to put ease my concerns. I even took out an MSDN universal subscription so I could begin using...
8
1635
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. Actually, the first release of this 'port' is be a simple rebuild of the unmanaged C++ SDK in VS.NET. I have done this part already, using VS.NET 2003.
41
18142
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
7987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8472
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8130
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6805
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3954
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.