I am seeing an example of ostream& operator<<(std::ostream& os, Loc& lc) that 
should work. did something change between now and 30 years ago?
 -------------
 Jim Michaels<jmich...@yahoo.com> j...@renewalcomputerservices.com
 http://www.RenewalComputerServices.com
 http://www.JesusnJim.com (computer repair info, programming)


      From: lh_mouse <lh_mo...@126.com>
 To: mingw-w64-public <mingw-w64-public@lists.sourceforge.net> 
 Sent: Thursday, March 31, 2016 10:04 AM
 Subject: Re: [Mingw-w64-public] improper errors on what should be valid code 
syntax
   
I have no idea what you are trying to do by putting stuff into the namespace 
std.

Again, you should attach your source file and let me have a look.

------------------                
Best regards,
lh_mouse
2016-04-01

-------------------------------------------------------------
发件人:Jim Michaels <jmich...@yahoo.com>
发送日期:2016-04-01 01:00
收件人:mingw-w64-public@lists.sourceforge.net
抄送:
主题:Re: [Mingw-w64-public] improper errors on what should be
    valid    code    syntax

excuse me again. the compiler has been thrown into some strange state where 
it's wildly tossing errors. I don't know what caused it. first error was 
overloading not allowed for at. probably at and erase for #3. 
#3.1 didn't change anything, but I changed T to _T.
2 If a program declares or defines a name in a context where it is reserved, 
other than as explicitly allowed by
this Clause, its behavior is undefined.... meaning what? how would I 
specifically use "this"?
thanks for the tips.

namespace std {    template<class _T>
    class tree {//outline or N-ary Tree



      From: lh_mouse <lh_mo...@126.com>
 To: mingw-w64-public <mingw-w64-public@lists.sourceforge.net> 
 Sent: Thursday, March 31, 2016 9:37 AM
 Subject: Re: [Mingw-w64-public] improper errors on what should be valid code 
syntax
  
Your code is NOT valid.
You are using the reserved identifier '_T'. Your code results in undefined 
behavior.

Attach the source file and let us see how to fix it.

------------------------------------
WG21 (ISO/IEC C++) N4582

2.10 Identifiers [lex.name]
3 In addition, some identifiers are reserved for use by C++ implementations and 
shall not be used otherwise; no
diagnostic is required.
(3.1) — Each identifier that contains a double underscore __ or begins with an 
underscore followed by an
uppercase letter is reserved to the implementation for any use.
(3.2) — Each identifier that begins with an underscore is reserved to the 
implementation for use as a name in
the global namespace.

17.6.4.3 Reserved names [reserved.names]
2 If a program declares or defines a name in a context where it is reserved, 
other than as explicitly allowed by
this Clause, its behavior is undefined.

------------------                
Best regards,
lh_mouse
2016-04-01

-------------------------------------------------------------
发件人:Jim Michaels <jmich...@yahoo.com>
发送日期:2016-04-01 00:30
收件人:mingw64 users
抄送:
主题:[Mingw-w64-public] improper errors on what should be valid code
    syntax



c:\jim\tree>g++ -std=c++11 -W -Wall -otree2.o tree2.cpp  2>tree2.err.txt
c:\jim\tree>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/gcc-5-win32/bin/../libexec/gcc/i686-w64-mingw32/5.3.1/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /home/cauchy/vcs/svn/gcc/branches/gcc-5-branch/configure 
--prefix=/home/cauchy/native/gcc-5-win32 
--with-sysroot=/home/cauchy/native/gcc-5
-win32 --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32 
--target=i686-w64-mingw32 --disable-multilib --disable-nls 
--disable-win32-registry --disab
le-gcov-tool --enable-checking=release --enable-languages=c,c++,fortran 
--enable-fully-dynamic-string --with-arch=core2 --with-tune=generic
Thread model: win32
gcc version 5.3.1 20160318 (GCC)

c:\jim\tree>





tree2.cpp:121:19: error: 'std::tree<_T>& 
std::tree<_T>::at(std::tree<_T>::VTREE_LEAVESI, std::tree<_T>::VTREE_LEAVEST&)' 
cannot be overloaded
         tree<_T>& at(VTREE_LEAVESI iCurNode, VTREE_LEAVEST& indices) {//by 
iterator - no recursion needed
                   ^
tree2.cpp:100:24: error: with 'std::tree<_T>::VTREE_LEAVESI& 
std::tree<_T>::at(std::tree<_T>::VTREE_LEAVESI, std::tree<_T>::VTREE_LEAVEST&)'
         VTREE_LEAVESI& at(VTREE_LEAVESI iCurNode, VTREE_LEAVEST& indices) 
{//by iterator - no recursion needed
                        ^
tree2.cpp: In member function 'std::tree<_T>::VTREE_LEAVESI& 
std::tree<_T>::linearAddress(std::tree<_T>::VTREE_LEAVEST&)':
tree2.cpp:203:47: error: 'indices' was not declared in this scope
             } else if (0!=leaves.size() && 0==indices.size()) {
                                               ^
tree2.cpp: At global scope:
tree2.cpp:248:12: error: expected initializer before 'operator'
         _T operator[](VTREE_LEAVEST& index) {
            ^
tree2.cpp:274:15: error: expected constructor, destructor, or type conversion 
before '(' token
         insert(VTREE_LEAVESI& iInsertionPoint, S_TREE_LEAVES& iTreeNode) {
               ^
tree2.cpp:279:20: error: variable or field 'erase' declared void
         void erase(VTREE_LEAVESI& iTreeNodeFrom, VTREE_LEAVESI& 
iTreeNodeToNotIncluding) {
                    ^



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


  
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


  
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to