Strange behaviour of CC compiler with templates

Hello!
I have noticed a strange behaviour of CC compiler.
The followint test-case compiles normally:
#include <stdio.h>
#include <complex>
using namespace std;
extern "C++" {
template <class FLOAT> complex<FLOAT>
cos (const complex<FLOAT>& x)
return complex<FLOAT> (cos (real (x)) * cosh (imag (x)),
- sin (real (x)) * sinh (imag (x)));
int main(){
return 0;
But if you commenty string
"using namespace std;" it gives error:
/opt/ss11/SUNWspro/bin/CC test.cc
"test.cc", line 8: Error: Templates can only declare classes or functions.
"test.cc", line 14: Error: A declaration was expected instead of "}".
2 Error(s) detected.
make: *** [test.o] Error 2
----

Class 'complex' is defined in the 'std' namespace. When you comment out 'using namespace std' compiler can't find definition of 'complex' and so treats function declaration as invalid construction. But I agree the error message is not quite clear.

Similar Messages

  • Strange behaviour on question slides with a countdown timer!

    Hello Captivators,
    I am facing a strange behaviour on question slides with a countdown timer. Whenever I place a countdown timer on a question slide, one of the options/answers disappear. What is going wrong here? Am I missing anythig in the settings?
    I am using Captivate 8 (Trial Version).
    Thank you for your support in advance.
    Greetings

    Sorry for the double question. However, I see that there are 10 Captivate communities and I thought I can post my question in one or some of them. Anyway, I know now that it is "Not very friendly" to do that. Sorry again!

  • Simple list won't compile with -template=wholeclass

    I have narrowed this down to a simple program:
    #include <rw/cstring.h>
    #include <list>
    void dave()
    std::list<RWCString> daveStr;
    When I compile with:
    CC -template=wholeclass -library=rwtools7_std -g -c Dave.cc
    I get errors:
    /opt/SUNWspro/WS6U2/include/CC/Cstd/./list.cc, line 351:Error:
    Too many arguments in call to "std::list<RWCString, std::allocator<RWCString>>::
    __adjacent_merge(std::list<RWCString, std::allocator<RWCString>>::iterator,
    std::list<RWCString, std::allocator<RWCstring>>::iterator, std::list<RWCString,
    std::allocator<RWCString>>::iterator)
    /opt/SUNWspro/WS6U2/include/CC/Cstd/./list, line 465: Where: While instantiating
    "std::list<RWCString, std::allocator<RWCString>>sort(bool(*)(const RWCString&,
    const RWCString &))
    /opt/SUNWSpro/WS6U2/include/CC/Cstd/./list, line 465: Where: Instantiated from
    non-template code.
    1 Error(s) detected.
    The temporary work-around is to not use- template=wholeclass, but isn't
    this something that should work. Has anyone else encountered this?

    Hello There,
    111685-0
    I compiled your testcase on our machine that has 111685-04 patch
    installed for C++ workshop 6 Update 2. I do not get any error message. It compiles fine.
    % CC6u2 -V -template=wholeclass -library=rwtools7_std -g -c template.wholeclass.cpp
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-04 2001/12/13
    ccfe: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-04 2001/12/13
    Please check your system if it requires to install patch.
    ....jagruti
    Developers Technical Support
    Sun Microsystems, http://www.sun.com/developers/support

  • Strange behaviour in Chromium browser with PDF links

    I am using the Chromium browser from the repository (v4.0.249) and xpdf as my PDF reader. xpdf launches fine from Firefox and Opera when clicking a PDF link in a website. Before I had Chromium set as my default browser Chromium would actually launch Firefox(!) and then FF would load the PDF document into xpdf. That in itself is strange. Now that I have Chromium set as my default browser (using "export BROWSER=/usr/bin/chromium" in ~/.bash_profile) when I click a PDF link Chromium opens a new tab and gives me this error:
    This webpage is not found.
    No webpage was found for the web address: file:///home/larry/Downloads/Hardware
    The Downloads directory is where all my downloads go. Any ideas on how to set up Chromium to use xpdf properly would be greatly appreciated. I went to the Chromium forum and there was a similar query with no response as of yet.

    Works for me™
    Do PDFs open in the right app if you open them with 'xdg-open path/to/pdf/file' ?
    Edit:
    I forgot to mention that I haven't set any "special" environment variables before using chromium.
    Last edited by R00KIE (2010-01-01 00:41:03)

  • Strange behaviour of Mail app with Google IMAP

    So lets say I compose a email with attachments (lets say 5 pictures) and while I do this mail application sends draft to the google server I have no problem with that.
    I have really slow upload speed so 16mb takes a while (~10 minutes). Now I wait until "draft" is fully sent to the google because I want mail/google to delete draft message when sent (this unwanted behaviour is commented here: Apple Mail puts a email in "DRAFTS" after I send it? ). When that is done (draft 100% on the google server) I SEND message and "what the heck is going on now" email is uploading AGAIN? - another 10 minutes browsing slowly.
    How can I prevent this behaviour?

    Sounds like you could try deleting the current keychain entry, then quit Mail.app. Open Mail.app again, when it asks for the password go ahead and type it in then just click Always Trust, etc. to see if it can hold onto that certificate this second time around. You also might have more than one entry in the Keychain list, so hunt around there a little to make sure you get everything deleted related to your Zimbra/Exchange IMAP accont.

  • Strange behaviour on delete button with immediate=true

    Hi, I'm using JDev11.1.1.2
    I have dragged a view object as a editable form on the page.I added navigation + delete/create buttons.
    As I see it all delete buttons should be immediate=true, because I want the user to be able to delete the current row despite validation errors (or maybe this is achievable some other way ? )
    But now when I press the delete button, only the readonly fields are updated with next record in the iterator, but the input fields are not updated (they remain with the delete row's values).
    If I set disable=true to an inputField, then it gets updated with the next row's value.
    I tried with partialTriggers on the inputFields to the delete button - but no luck!
    Why I get this different behaviour on inputFields and outputText when the delete button is immediate=true?
    And how to deal with this problem?
    Thank you!

    Thank Frank for the answer, but still no luck
    Here is my code:
    <af:form id="f1" partialTriggers="cb6">
         <af:panelFormLayout id="pfl1" partialTriggers="cb6">
           <af:inputText value="#{bindings.Kod4.inputValue}"
                             required="true"
                             id="it1" partialTriggers="cb6">
         </af:inputText>
         <af:outputText value="#{bindings.Kod4.inputValue}" id="out1"/>
         <af:commandButton actionListener="#{bindings.Delete.execute}"
                               text="Delete" immediate="true" partialSubmit="true"
                               id="cb6"/>
         </af:panelFormLayout>
    </af:form>As you can see there are one output and one input field for a same attribute ... the output field gets updated on delete, but the input - doesn't
    There are partialTriggers and partialSubmit but still no luck
    My view is really a simple one - 3 fields, based on an entity. Tried with different view objects - still the same effect occurs.
    I don't see how a delete button can be of any help to the user if it is NOT immediate=true. I cannot add a row and delete it right away if there are validation errors
    Please help!
    Thanks

  • Strange behaviour of PC Suite with 6500c after sof...

    Hi everyone, 
    I have a 6500c connected via USB to my PC running PC suite.  For ages I've been able to send and receive messages via the PC Suite quite happily and view contacts etc.  But that has stopped since I updated my firmware and the PC Suite software.
    Now when I plug the phone into the USB cable, it no longer sychronises with PC Suite (I choose PC Suite from the phone).  PC Suite recognises the phone, charges the battery and I can still browse the phone's memory.  I can still send messages, but if I click the refresh button in the Nokia Communication Centre, it will not refresh my messages so I can't read them or reply to any.  The drop down in the number field also doesn't show numbers/names from the phone.
    If I go to the Contacts app of PC Suite, it reports "Refreshing of contacts failed"
    When I go to "Settings > Settings..."  and click "Check the notifications supported by this device: Nokia 6500c" it runs the test and says the phone supports the following:
    Notifications for incoming calls : Yes
    Notifications for incoming messages : No
    Battery level notification : Yes
    I've reinstalled the firmware and PC Suite but it's still no better.  I can't do a Restore All factory default on the phone as I don't know the code it asks for!
    The 6500c firmware is v09.45 (the latest according to the software updater)
    The PC Suite version is 7.1.18.0
    Can anyone help me?
    Any help gratefully aprreciated!!
    Steve

    Hi,
    I'm facing this same problem from december 2009. Phone notifications does not work. Battery level bar doesn't work too (only in BT mode).
    These are known isues of 7.1.18.0 still not removed.
    If you want have your old functionalities, install older version 7.0.9
    Code for factory default should be 12345, if not changed.
    Cheers
    N95 & N96 User

  • Strange behaviour of Crystal report with BEx Query

    Hiii. All
    I have created a crystal report on top of BW-BEx query. My query contains a structure other than Keyfig.
    Thats why I am using BW-MDX query option to build my Report.
    i Have created a cross tab in my report taking the structure as Column and some key figures in Summarised fields.
    till here it works fine. but whenever I am dragging some fields say "Project Defination or Location" to  report header section, which are also coming frm BEx query. then my cross tab is not showing all colomn of the structure(Precisely it removing one column of the structure).
    Can anyone pls tell me  why is it happening. and how to proceed to solve this.
    Waiting for your reply..
    Thanks
    Anish

    Hi,
    Thanks for your reply.
    Yes it returning data . Structure contains total 13 columns .
    So It is suppose to return all 13 of them. and it is doing so till i don't drag-drop the field. once i do this its behaving strangely and returning me only 12 columns.
    CR 2008 Version : 12.3.0.601
    BO Version : BO XI  3.1
    Regards,
    Anish

  • IPhoto: strange behaviour with preview thumbnails

    Is there a simple way in iPhoto 8 to rebuild the thumbnail database?
    I recently noticed a strange behaviour iPhoto 8 has with previews: In some of my event categories, iPhoto does not display the correct preview thumbnail of the picture, but a preview thumbnail of another event. When I click on the thumbnail, it reloads the appropriate preview and it does not happen again - with that picture. Also, if I double click an event to open it, the small thumbnail of the event's key photo that is to be displayed in the title bar (next to the All Events button) is not always correct.
    Thank you for your help!
    Stefan

    I have similar problems (lately) with iPhoto 6.0.6 -- thumbnails do not equal the images they 'thumbnail' of.
    Sometimes when it opens, it (recently) asked me to rebuild the thumbnails, but not always.
    Can I force a thumbnail rebuild using the command you gave - Apple-option while opening iPhoto? In iPhoto 6.0.6 this primarily forces a new selection of a library.

  • Strange behaviour with Slideshow placement since upgrade to 3.2 from 3.1

    Hello, since I upgrade from 3.1 to 3.2, I have some strange behaviours but in particular with the placement of a slideshow on a new page.  It is not displaying in the same position as I have in in Design.  It is way off and going up over my menus when I look at it in Safari or Chrome.  Does anyone know how to fix this or could it be a bug?

    Ben,
    When you upgrade, only apex_030200 will be created and that will use the tablespace you specify. It does not have to be the same one used by flows_030100.
    Scott

  • Strange behaviour with combo boxes.

    Has anyone else noticed strange behaviour of combo boxes with applets?
    What happens is that on selecting the combo drop down, the dialogue the combo is sitting on moves behind its parent window. You just end up seeing the combo list, and no dialogue. Select a combo item, and sometimes the dialogue reappears, and sometimes it is still hidden.
    I've only seen this whilst running an applet in browsers. In Eclipse I don't see the behaviour.
    The behaviour is also very intermittent.
    I'm using Java Plug-in 1.6.0_10-rc2, Using JRE version 1.6.0_10-rc2 Java HotSpot(TM) Client VM, on Windows Vista, Google Chrome browser.
    I'd raise it as a bug, it certainly seems quite serious, but I don't have a reliable test case.
    I have a work around, on all my dialogues with combo's on them, I have setAlwaysOnTop(true). Not really the correct behaviour though.

    GeoffTitmuss wrote:
    No, I believe I am just using Swing components.Ok, then I'm out of ideas

  • P43-Neo Strange behaviour with LG IDE/PATA DVD Burner attached

    Hello, I have spent several hours installing an OS on my new MSI P43 Neo-F v1.0 Bios v1.9:
    - 1x 1000 GB SATA HDD Seagate
    - 1x DVD Burner LG IDE/PATA HL-DT-ST_DVDRAM_GSA-H42N Firmware RL01
    - 4GB OCZ Gold
    - MSI RX2600 Graphic Card
    - Bequit! Power Supply 350 Watt
    Trying to boot from the DVD Drive works, but either XP not Vista could make it to the setup screen.
    - Vista stops after some seconds with an unexpected I/O error.
    - XP Setup just crashes and dumps register values.
    Boot from USB memory stick (DVD still attached but no DVD in) lets you enter the setup and select the HDD as intall target. But, if you click "next" it gives you a message that Vista could not verify if a suitable system disk is installed.
    I could only solve the problem by completely disconnecting the GSA-H42N DVD Burner from the IDE/PATA connector.
    I could install Vista now from USB.
    After Vista was installed I reconnected the GSA-H42N DVD Burner to the IDE/PATA connector and could install software etc.
    Anyone being able to comment on this very strange behaviour ?
    In conjunction with other boards I did not encounter issues like this with that LG DVD Burner.
    It has shown that with the MSI P43 Neo F the LG GSA-H42N is unable to boot any CD/DVD. Linux for example stops booting with image crc check error.
    I have now swapped the LG GSA-H42N with an GSA-H10N from my other machine and it can boot any CD/DVD from it - everything runs fine.
    The LG GSA-H42N now runs with my other machine (with an Asrock P43 DE motherboard) also without any problems it can boot any CD/DVD from it
    Thank you,
    CPU

    Please post your Full System Specs with PSU specs amps.
    >>Posting Guide<<

  • Strange behaviour (bug?) of 3D widget on iPad2

    Hi,
    I've just encoutered very strange behaviour when playing around with 3d widget.
    Here's what I'm doing:
    Created new project from basic template,
    On section page removed everything and placed two simple 3d objects (~7000 faces each no textures) and removed title, description, background etc from them, both was set to autorotate.
    Send to my iPad using preview button.
    What's happening:
    When page with 3d objects opens one of them behaves as expected (autorotate), but other is either unresponsive for a very long time (few minutes) or you have to pinch it to full screen to be able to interact with it, however when you close full screen mode every thing gets normal and you can play with both objects at once.
    It looks like a bug to me, but maybe someone else could try to reproduce this behaviour to rule out configuration factors.
    Do you know when I could fill bug report?
    Best regards,
    Jacob

    While there is no formal bug reporting method similar to what devs have w/apps, iBA does have a 'Provide iBooks Author Feedback' menu item.
    As well, confirm your 3d related process here:
    iBooks Author: Best practices for using 3D models - Support - Apple

  • View Master mode strange behaviour with jpg files

    Hy all,
    I'm using Aperture, and I'm tweakin a lot the SW to discover all secrets ....
    I'm really concerned about a strange behaviour of the SW in view mode.
    If I open a jpg file, do not apply ANY modification, and apply the "show master" command (pressing M), there's a subtle behaviour :
    *the images get sharper !!!!*
    It behaves as if an "edge sharpening" was applied !!!!!!
    With _RAW files this thing doesn't happen at all._
    Even stranger, if I zoom to full definition (by pressing Z), and toggle between normal view and "show master" view, the immage remains the same !
    The effect is not so evident with all images, but sometimes it is !!
    Anyway, I expect not to have such kind of things with a professional SW.
    With professional cameras and good quality files it's really annoying not to beeing sure what's the REAL content of the jpg image.
    Has anyone noted this thing ? Is there a reasonable explanation ?
    The only one I tried to figure out is the following : may be Aperture applies some kind of resampling algorithm with jpg files (bicubic, bilinear, etc).
    May be this resampling is not applied with 100% magnification, as weel as with raw files.
    But it's only my guessing. Now, I'm tweaking other viewers and other SW to understand what's the real jpg image stored in the file : the blurer one form normal view or the sharper one with "show master" mode.
    I stress once again : of course, the jpg file I'm talking about have no settings at all, just imported and toggled with M button.
    Thanks in advance.
    Regards,
    Enzo

    Hy,
    I'm afraid I'm not been clear.
    The problem is this :
    1) jpg image opened in normal view mode, no zoom, (no quick preview, of course) : image with a certain amount of blour
    2) jpg image opened in show master mode, no zoom, (no quick previre, of course) : image SHARPER with respect with the previous.
    No edit applied from import, so "show master" command shouln't apply any change in rendering, should it ?
    The only thing I said on 100% view is that such difference (between normal mode e show mastermode) is not present with 100% magnification.
    That was the issue.
    Enzo

  • Strange behaviour with Safari.

    Very strange behaviour with Safari this morning.   Pages loading piecemeal or partially.   The content only becomes viewable after the cursor has passed over the area.   Have cleared caches and reported it but I'm wondering if this is a local matter here in the UK.   Anyone suffering similar problems?    Firefox is responding perfectly normally.

    I see a reply has come back via a previous post.   As I am trying to get a response to this one I shan't reply there but I should point out that for me, this is an isolated problem.   I do use open DNS but with no track history of problems there , I can't blame that.
    In the last few minutes normality has returned.

Maybe you are looking for