Diffence between OVERLOADING and POLYMORPHISM

hi all
i need the differneces between
overloading and polymorphism (atleast 3 differences :)))
regards,
venkat.

can u send me any list of core java questions if u have. http://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Similar Messages

  • What's the difference between "overloading" and "overriding" in Java

    What's the difference between "overloading" and "overriding" in Java

    hashdata wrote:
    What is the real-time usage of these concepts...?Overriding is used when two classes react differently to the same method call. A good example is toString(). For Object it just returns the class name and the identityHashCode, for String it returns the String itself and for a List it (usually) returns a String representation of the content of the list.
    Overloading is used when similar functionality is provided for different arguments. A good example is [Arrays.sort()|http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#sort(byte%5B%5D)]: all the sort() methods do the same thing (they sort arrays), but one sorts byte-arrays, another one sorts int-arrays, yet another one sorts Object-arrays.
    By the way, you almost certainly mean "real-world" usage. "real-time" (and thus "real-time usage) means something entirely unrelated to your question.

  • Difference between OVERLOADING and OVERRIDING??

    Hi guys,
    can you please exaplain me difference between Overloading & Overriding with example?
    Thanks,
    JaxNa

    Here is the example of overriding :
    /* PARENT CLASS */
    package com.example.supreclass {
         public class parentClass {
              public function parentClass() {
              public function fromParent(myString:String):void {
                   trace("Output :", myString);
    /* DERIVED CLASS */
    package com.example.supreclass {
         public class myExample extends parentClass {
              public function myExample() {
              /* Override the method */
              override public function fromParent(outputStr:String):void {
                   super.fromParent(outputString);
                   trace("Override example");
    Overriding means redefining the inherited method (the parent method still can be invoked using 'super', as shown in example )
    These links should give you some idea on these :
    Overriding : http://www.kirupa.com/forum/showthread.php?p=1896981
    Overloading means having many functions with same name but each differs by parameters it takes (either by data type or number of parameters passed) and return value.
    Overloading : http://www.techper.net/2008/07/08/missing-method-overloading-in-as3/

  • Diffence between ck11n and ck40

    1.what is the difference between ck11n and ck40
    2.what is the use of  product version

    Hi Madhu,
    CK11N is used to release Cost estimate for individual material then
    CK24 for Markup & Release in Material Master Data
    CK40 will carry calculate& Mark up & Release in one step and update material master data.
    It is also carreid for all the material.
    Best Regards
    Ashish Jain

  • Diffences between 9i Standard and Enterprise edition

    Can anyone give me the Diffences between 9i Standard and Enterprise edition. Is there any document available for this.
    Thanks,
    Sunil.

    Here's the Oracle white paper on the subject...
    http://otn.oracle.com/products/oracle9i/pdf/9idb_rel2_prod_fam.pdf
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Diffence between sap ecc5 and ecc5(IS Retail

    Dear all
    what is major diffence between   sap ecc5 and ecc5(IS Retail)
    thanks
    venkat

    Hi,
    ECC5 ( IS Retail) contain  SAP Industry-Specific Components IS -Retail
    check the release notes for both ECC5 and ECC5 IS - Retail
    login into service.sap.com -> Release & Upgrade Info -> Release Notes ->SAP Industry-Specific Components ->
    SAP for Retail
    regards,
    kaushal

  • Diffence between XI 3.0 and PI7.0

    Hi
    I am having one dought. what are defferences between XI 3.0 and PI 7.0 at Mapping and in IR and ID.

    Hi,
    1.All new features for XI 7.0 are almost same as for XI 3.0 at least till SPS 19.
    Some differences are as follows:
    • Adapter Enhancements like JMS, JDBC, Oracle-JDBC and CIDX Enhancements
    • New Conversion Agent,
    • Receiver Determination Enhancements
    • Multi mapping
    • User defined enhancements
    • Unbounded Processes (Integration Processes).
    2. One more difference is the ABAP stack (which is 7.0 and not 6.40) but from the developer point of view there is nothing new.
    3. PI 7.0 = XI 7.0
    4. For each SP in XI3.0 there is a corresponding SP being released for PI (XI 7.0). A comparison of the service packs in 2004 and 2004s:
    In 2004 - In 2004s
    SP12 & lower = SP04
    SP13 + 14 = SP05
    SP15 = SP06
    SP16 = SP07
    SP17 = SP08
    SP18 = SP09
    5. XI3.0 is based on WAS(web application server)6.40 - NW2004
    PI7.0 is based on WAS(web application server)7.0 - NW2004's
    There is not much difference between XI 3.0 with latest Service Pack i.e. 20 or 21 and PI 7.0
    The main difference between 3.0 and 7.0 is the GUI in SLD. But, it is pretty easy to adopt. All other components, e.g. IR, ID, RWB, should virtually be identical.
    7.0 also contain some SCM contents not available from 3.0. For most of us, this is a non-issue.
    In 7.0 we can schedule a background job and edit the payload.
    XI3.0 is based on WAS(web application server)6.40 - NW2004
    PI7.0 is based on WAS(web application server)7.0 - NW2004's
    Currently SP 21 for XI 3.0 and SP12 for PI 7.0 is the latest one.
    ref:http://help.sap.com/saphelp_nw04/helpdata/en/cf/9844428e9cbe30e10000000a155106/frameset.htm
    See This Thread on the Same Discussion
    Diff between XI and PI
    http adaptor on which factors we will use
    differences between xi 3.0 and pi 7.0
    Difference/ changes from XI 3.0 to PI 7.0
    give me main advantages of XI-7.0 TO XI-3.0
    XI 7.0 vs Xi 3.0
    XI/PI
    XI vs. PI
    XI 3.0 vs. PI (XI 7.0)
    Difference/ changes from XI 3.0 to PI 7.0
    moving from XI 3.0 to PI 7
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/xi%2band%2bpi%2bglossary
    Reward points if helpful.
    Thanks,

  • What is the diffrence between extends and creating new object?

    HI ALL,
    what is the diffrence between extends and creating new object?
    meaning
    class base{
    class derived extends base{
    class base{
    class derived {
    derived(){
    base var = new base();
    can u people tell me diffence from the above examples.
    THANKS.
    ANANDA

    When you create a new object you have to supply the class to which that
    object belongs. A class can extend from another class. If it does so
    explicitly you can define the 'parent' class from which the class extends.
    If you don't explicitly mention anything, the class will implicitly extend
    from the absolute base class named 'Object'.
    Your example is a bit convoluted: when you create a Derived object,
    its constructor creates another object, i.e. an object from the class from
    which the Derived class extends.
    Extending from a class and creating an object don't have much in common.
    kind regards,
    Jos

  • What is the difference between component and sub-assebly?

    Experts,
    What is the diffence between sub-assembly and a component?
    in my report if user enters component it should display sub-assembly. if it is reverse should not get component for that.
    is there any function module for this?
    I tried in CS15 but not get exact information.
    please help me...

    Hi,
    component is nothing but one of small product. So many no.of products could combine and they will give one big product. For that particular component one or more sub-assemblies can be used.
    Sub-assembly will contain one or more no of  small contents.
    14' inch boltnut is one of sub-assembly for the one big component.
    In that boltnut sub assembly  might contains bolt , nut and washer. That is called sub-assembly.
    Thanks,
    Shankar

  • Objects, Overloading, and Stock Prices

    The problem - Write a program that has the following:
    Data:
    A string field named symbol for the Stock’s symbol.
    A a string named sName for the Stock’s name.
    A double field named previousClosingPrice that stores the stock’s prices form the previous day.
    A double data field named currentPrice that stores the stock price for the current time.
    Behaviors: (i.e. methods)
    A default Constructor.
    An overloaded Constructor that takes a stock with a specific symbol, name, and last closing price. ** Note values for current stock price will have to be initialized to zero.
    A toString(); function that returns the current stock’s name, Symbol, and current price.
    A method named getChangePercent(); that returns the percentage changed between previousClosingPrice and currentPrice.
    A method named setCurrentPrice(double); that allows the setting of the current stock price.
    Write a test program that creates a Stock object with the symbol ORCL, the name Oracle Corporation, and the previous closing price of 34.5.
    Also, have the test program call the toString(); method to see it’s definition.
    Lastly, set the new stock price to 34.35 and then display the price change percentage.
    My problem is the math aspect to calculate the percentage. My result is "Infinity", which is obviously wrong. What am I missing here?
    package stockPrice;
    public class Stock {
    //Set Data fields
         public String symbol;
         public String sName;
         public double previousClosingPrice;
         public double currentPrice = 0;
    //Default Constructor
         public Stock(){
    //Constructor with previous closing price parameter
         public Stock(String newSymbol, String newSName, double newPreviousClosingPrice) {
              this.symbol = newSymbol;
              this.sName = newSName;
              this.currentPrice = newPreviousClosingPrice;
    //Return Percent Change
         double getChangePercent(){
              return (((previousClosingPrice - this.currentPrice)/previousClosingPrice)*100);
    //Set a new Current Price
         double setCurrentPrice(double newCurrentPrice){
              this.currentPrice = newCurrentPrice;
              return this.currentPrice;
         @Override
         public String toString() {
              // TODO Auto-generated method stub
              String total = "The symbol is: " + this.symbol + " and the name is: " + this.sName + " and the previous closing price is: " + this.currentPrice;
              return total;
    }Driver:
    package stockPrice;
    public class Driver{
         public static void main(String[] args) {
         //Driver Program for all testing and Instantiation     
              Stock stock1 = new Stock ("ORCL", "Oracle Corporation", 34.5);
              System.out.println(stock1.toString());
              stock1.setCurrentPrice(34.35);
              System.out.println(stock1.toString() + ". The percent change is: " + stock1.getChangePercent());
    }

    So is setting the price as simple as this? (Keeping in mind this is my first JAVA class I am taking)...
    package stockPrice;
    public class Stock {
    //Set Data fields
         public String symbol;
         public String sName;
         public double previousClosingPrice = 34.5;
         public double currentPrice = 0;
    //Default Constructor
         public Stock(){
    //Constructor with previous closing price parameter
         public Stock(String newSymbol, String newSName, double newPreviousClosingPrice) {
              this.symbol = newSymbol;
              this.sName = newSName;
              this.currentPrice = newPreviousClosingPrice;
    //Return Percent Change
         double getChangePercent(){
              return (((previousClosingPrice - this.currentPrice)/previousClosingPrice)*100);
    //Set a new Current Price
         double setCurrentPrice(double newCurrentPrice){
              this.currentPrice = newCurrentPrice;
              return this.currentPrice;
         @Override
         public String toString() {
              // TODO Auto-generated method stub
              String total = "The symbol is: " + this.symbol + " and the name is: " + this.sName + " and the previous closing price is: " + this.currentPrice;
              return total;
    }

  • Diffence system.current_item and system.cursor_item

    hi
    Diffence system.current_item and system.cursor_item
    and diff between decode and case stmt Which is best to use.
    thanks

    the :system.current_<...> - variables are for upgrade-compatibility with older forms. Don't use them.
    Forms-Help :
    Note: SYSTEM.CURRENT_ITEM is included for compatibility with previous versions. Oracle recommends that you use SYSTEM.CURSOR_ITEM or SYSTEM.TRIGGER_ITEM instead.

  • Difference between EP6 and EP7

    Hi Experts,
    Can anyone tell me the major difference between EP6 and EP7 ?
    Thanks in advance.

    Dear Vinay,
    Notice the below threads to get major understanding on diffences between EP versions.
    difference between EP6 and EP7
    Urgent : Difference between EP6 and EP 7?
    Difference between EP 6.0 and EP 7.0
    what is difference between EP 6 and EP 7  as well as Netweaver 2004 &20004s
    Regards
    Ankur
    P.S. Points for useful answers.

  • Help with my Project - Includes Arrays, Inheritance and Polymorphism

    COMP 1900 CS1: Introduction to Programming
    Programming Assignment 4
    Objectives:
    * To work with superclasses and subclasses
    * To work with an abstract class
    * To gain experience working with an array of objects
    Requirements:
    * Understanding of arrays (Sections 7.1-7.3)
    * Understanding of inheritance (Chapter 8)
    * Understanding of polymorphism (Sections 9.1-9.2)
    Assignment:
    Write a Java application for a company payroll that has three different types of employees: secretary, junior salesman and senior salesman.
    * Design an employee superclass that contains an instance variable for the employee name. In addition, there should be an (abstract) method to compute the yearly bonus that employees receive in the month of December.
    * Design subclasses for each type of employee. The secretary subclass should have two instance variables: one corresponding to the initial year of employment and the other representing the salary. The junior salesman class has instance variables for base salary, total sales, and commission rate. The senior salesman class has one instance variable representing the total sales.
    * Design get and set methods for each class. Each class should also have a toString method.
    * Design a computeCommission method for each of the salesman classes as follows:
    o For a junior salesman, the commission rate is set.
    o For a senior salesman, the commission rate is variable based on total sales.
    For sales < $10,000,000: the commission rate is 0.1%;
    For sales between 10 and 25 million inclusive, the commission rate is .2%;
    For sales over 25 million, the commission rate is .25%.
    * Design a computeBonus method for all employee classes as follows:
    o For secretarial staff, bonuses are dependent on the number of years that an employee has worked for the company. If an employee has worked less than 5 years, the bonus is $50; for 5 to 10 years, inclusive, the bonus is $75; for over 10 years, the bonus is $100.
    o For junior salesman, the bonus is .01% times the sum of the yearly salary and the total commission for the year.
    o For senior salesman, the bonus is .025% of the total sales.
    * Design a class EmployeePayroll that has an instance variable that is an array of Employee objects.
    * Design methods addEmployee and toString.
    * Design a method that computes the average of all employee bonuses.
    * Design the method that counts how many employees received a bonus bigger than the number sent in as parameter.
    * Design a method that finds the employee that has earned the biggest bonus.
    * Design a class TestEmployeePayroll that creates an array with 9 Employee objects (3 of each type) and tests each of the methods that you wrote. Initially, for testing purposes you can hardcode the values for Employee objects being created, but when completed you need to ask for interactive input from the user.
    I am having trouble with how to write an abstract method to compute the yearly bonus inside of the employee superclass.
    I am also having a lot of trouble with the EmployeePayroll class. I can't think of the best way to do the addEmployee method. I am just getting stuck and very frustrated. Help would be greatly appreciated. Thanks.

    This is all I have so far.
    public class Employee
        protected String name;
        public void setName(String name)
            this.name = name;
        public String getName()
            return name;
    public class Secretary extends Employee
        private int initialYear = 0000;
        private double salary = 0.0;
        public void setInitialYear(int initialYear)
            this.initialYear = initialYear;
        public int getInitialYear()
            return initialYear;
        public void setSalary(double salary)
            this.salary = salary;
        public double getSalary()
            return salary;
        public double computeBonus()
            double bonus = 0.0;
            if(2007 - initialYear < 5)
                bonus = 50.00;
            else if(2007 - initialYear >= 5 && initialYear <= 10)
                bonus = 75.00;
            else if(2007 - initialYear > 10)
                bonus = 100.00;
            return bonus;
        public String toString()
            return "Initial Year: " + initialYear + ". Salary: " + salary + ". Bonus: " + computeBonus() + ".";
    public class JuniorSalesman extends Employee
        private double baseSalary = 0.0;
        private double commissionRate = 0.0;
        private double totalSales = 0.0;
        public void setBaseSalary(double baseSalary)
            this.baseSalary = baseSalary;
        public double getBaseSalary()
            return baseSalary;
        public void setCommisionRate(double commissionRate)
            this.commissionRate = commissionRate;
        public double commissionRate()
            return commissionRate;
        public void setTotalSales(double totalSales)
            this.totalSales = totalSales;
        public double getTotalSales()
            return totalSales;
        public double computeBonus()
            return .001 * (baseSalary + commissionRate);
        public String toString()
            return "Base Salary: " + baseSalary + ". Total Sales: " + totalSales + ". Commission Rate: " + commissionRate + ". Bonus: " + computeBonus() + ".";
    public class SeniorSalesman extends Employee
        double totalSales = 0.0;
        public void setTotalSales(double totalSales)
            this.totalSales = totalSales;
        public double getTotalSales()
            return totalSales;
        public double computeCommission()
            double commissionRate = 0;
            if(totalSales < 10000000)
                commissionRate = 0.001;
            else if(totalSales >= 10000000 && totalSales <= 25000000)
                commissionRate = 0.002;
            else if(totalSales > 25000000)
                commissionRate = 0.0025;
           return commissionRate;
        public double computeBonus()
            return totalSales * .0025;
        public String toString()
            return "Total Sales: " + totalSales + ". Commission Rate: " + computeCommission() + ". Bonus: " + computeBonus() + ".";
    }

  • Relation between plant and shipping point

    Hi all,
    my simple question is,  what is the relation between plant and shipping point ?
    in book i read, it is                      many to many,
    but in some web link it is showing 1 to many
    what is the logic behind these two ans.
    pls tell me the ans...
    Regards
    Avinash

    Hi Hegal . K . Charles,
    it is correct,  as we discussed above it may be MANY to MANY .
    Suppose, we hv 2 plant 1 in delhi and 2nd in nagpur. and this company want to export via inland water ways, in this case we can assign mumbai port to delhi and nagpur plant as well.
    as you said it is correct, It is just  not to overload the master data maintenance 
    Ex- In case of Sales Org. Its is always advisable to keep it minimum to per company code. Because master data records are multiplied by each additional org. element.

  • Differnce between LibCstd and LibStlport

    Hi
    what is the main difference if we Build application with LibCStd and LibStlport

    libCstd is potentially probably more standard-conforming than STLport
    In fact the Apache stdcxx is derived from the same roots - libCstd is just an older version of RogueWave Standard C++ Library
    All the seemingly missing parts are actually implemented in the headers but switched off by configuration macros setup in <tt>/opt/solstudio12.2/prod/include/CC/Cstd/stdcomp.h</tt>
    The configuration is by no means obtained from the automatic script (as suggested in the header itself) and it presents <tt>CC</tt> as an incapable old-fashioned pre-standard compiler (like from the times of SPARCWorks) that does not understand many advanced template features needed for implementating full standard by the library
    One has three choices to unlock standard features in libCstd:
    <ol>
    <li> Edit the <tt>CC/Cstd/stdcomp.h</tt> and make the following macros undefined (easier by commenting out their definitions)
    </li>
    <li> Create a file named <tt>stdcomp.h</tt>, fill it with properly edited contents and add the path using <tt>-I</tt> directive. This will cause the compiler to use created file instead of the original </li>
    <li> Create a file named <tt>stdcomp.h</tt> that will <tt>#include</tt> the original and adjust the macros. As with 2. include path needs to be provided with <tt>-I</tt>
    The fixed <tt>stdcomp.h</tt> header should look like:
    #ifndef _FIXED_STDCOMP_INCLUDED_
    #define _FIXED_STDCOMP_INCLUDED_
    // Include the original
    #include <Cstd/stdcomp.h>
    // Clear offending macros
    #undef _RWSTD_NO_MEMBER_TEMPLATES
    #undef RWSTD_NO_MEMBER_TEMPLATES
    #undef _RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES
    #undef _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
    #undef _RWSTD_NO_FRIEND_TEMPLATES
    #undef RWSTD_NO_FRIEND_TEMPLATES
    #undef _RWSTD_NO_MEM_CLASS_TEMPLATES
    #undef RWSTD_NO_MEM_CLASS_TEMPLATES
    #undef _RWSTD_NO_TEMPLATE_TEMPLATE
    #undef RWSTD_NO_TEMPLATE_TEMPLATE
    #undef _RWSTD_NO_EXPLICIT_ARG
    #undef RWSTD_NO_EXPLICIT_ARG
    #undef _RWSTD_NO_STATIC_MEM_DEF
    #undef RWSTD_NO_STATIC_MEM_DEF
    #undef _RWSTD_NO_DEFAULT_FOR_TPARAM
    #undef RWSTD_NO_DEFAULT_FOR_TPARAM
    #undef _RWSTD_NO_PART_SPEC_OVERLOAD
    #undef RWSTD_NO_PART_SPEC_OVERLOAD
    #undef _RWSTD_NO_INIT_CONST_TEMPLATE_REF_ARG
    #undef RWSTD_NO_INIT_CONST_TEMPLATE_REF_ARG
    #undef _RWSTD_NO_CLASS_PARTIAL_SPEC
    #undef RWSTD_NO_CLASS_PARTIAL_SPEC
    #undef _RWSTD_NO_FUNC_PARTIAL_SPEC
    #undef RWSTD_NO_FUNC_PARTIAL_SPEC
    #undef _RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
    #undef RWSTD_NO_TEMPLATE_ON_RETURN_TYPE
    // prevent the original from #define'ing the macros again
    #define RW_NEVER_ENTER_DEFAULT_HEADER_BLOCK 1
    // clear inclusion guard
    #undef __STD_RWCOMPILER_H__
    // include original once more
    #include <Cstd/stdcomp.h>
    // macro from stdcxx-4.x.x, used by vector<bool>
    #if defined(_RWSTD_ALLOCATOR) && !defined(_HPACC_)
    # define _RWSTD_REBIND(alloc, type) _TYPENAME alloc::template rebind<type>::other
    #else
    # define _RWSTD_REBIND(alloc, type) allocator_interface<alloc, type>
    #endif
    #endifDouble inclusion of original header is necessary because more macros will be defined after our #undefine's
    To prevent warnings about macros redefinition with second include more #undef's can be added, e.g. for <tt>RWSTDVER</tt>, <tt>RWSTD</tt> or <tt>__RWSTD</tt>
    The purpose of macro <tt>RWSTDREBIND</tt> will get clear in the following discussion. One may wish to add this definition if editing the original file in place.
    </li>
    </ol>
    No matter which solution is chosen there are a few other considerations:
    <ol>
    <li><tt>CC</tt> by default has implicit inclusion feature - it automatically includes files with template implementation during compilation. For a header <tt>name.extension</tt> it looks for files <tt>name.cc</tt> and <tt>name.cpp</tt> on include path and uses them without an explicit <tt>#include "name.cc"</tt>. This feature is used by <tt>libCstd</tt>, e.g. <tt><vector></tt> header includes <tt>vector.cc</tt> only if <tt>RWSTDCOMPILE_INSTANTIATE</tt> macro is defined (by default it is undefined).
    Though the feature is useful it may cause problems when a header named like one of the standard library is used (e.g. <tt><boost/container/vector.hpp></tt>). The compiler looks for an implementation file and uses the one from libCstd (<tt>CC/Cstd/vector.cc</tt> in this case). As the corresponding standard header has not been included it complains about defining methods for non-existing template class <tt>std::vector</tt>.
    If <tt>Boost.Container</tt> or other similar library is to be used one should add <tt>-template=no%extdef</tt> compiler option and define the macro <tt>RWSTDCOMPILE_INSTANTIATE</tt>.
    <li>Changes to <tt><stdcomp.h></tt> turns <tt>std::iterator_traits</tt> template on but the corresponding <tt>__iterator_category</tt> function specialization is missing. The best place for it is standard <tt><iterator></tt> header:
    #ifndef _ITERATOR_FIX_INCLUDED_
    #define _ITERATOR_FIX_INCLUDED_
    #include <Cstd/iterator>
    namespace _RW_STD {
    template<typename _IterT>
    inline typename iterator_traits<_IterT>::iterator_category
    __iterator_category(const _IterT&)
        return typename iterator_traits<_IterT>::iterator_category();
    #endif // _ITERATOR_FIX_INCLUDED_
    Note that the hacked file should be named <tt>iterator.SUNWCCh</tt> to be used by the compiler. CC does not include standard headers from files without that extension(of course one may edit <tt>CC/Cstd/iterator.SUNWCCh</tt> file directly)</li>
    <li>The changes unlock templatized constructor in <tt>std::pair</tt> class which can lead to ambiguity between overloads of <tt>insert</tt> methods of <tt>std::map</tt> container, namely
    pair<iterator, bool> insert(const value_type&);  // value_type is a typedef for pair<const key_type, mapped_type>
    pair<iterator, bool> insert(const pair<key_type, mapped_type>&);when called with an argument like <tt>std::make_pair(key, value)</tt> the compiler is not able to choose overload because the templatized <tt>pair</tt> constructor can convert between pairs that only differ in constantness of their components
    This time there is no <tt>#include</tt>-then-fix solution - one may edit the original <tt>CC/Cstd/map.SUNWCCh</tt> file or copy its contents to another location (again, remember about <tt>.SUNWCCh</tt> extension) and edit it there.
    The fix is to remove method
        pair<iterator, bool> insert (const pair<key_type, mapped_type> &__x)Best may be using conditional:
    #ifdef _RWSTD_NO_MEMBER_TEMPLATES
        pair<iterator, bool> insert (const pair<key_type, mapped_type> &__x)
    //... implementation
    #endifBe aware it is <tt>#ifdef</tt> here (not <tt>#ifndef</tt>) so the code gets excluded as <tt>RWSTDNO_MEMBER_TEMPLATES</tt> has been undefined
    </li>
    <li>With full partial template specialization support turned on we get into troubles with <tt>std::vector<bool></tt> class. The compiler complains that <tt>__first.p</tt> is inaccessible from <tt>vector<bool>::~vector()</tt> though <tt>vector<bool>::iterator</tt> contains friend class vector<bool, Allocator>;Changing that to friend class vector; fooled the compiler in full:
    >
    <tt>>> Assertion: (../lnk/ftemplate.cc, line 498)
    while processing libs/program_options/src/options_description.cpp at line 242</tt>
    >
    This looks like error in the compiler, in other contexts friend declarations in partially specialized classes work. When using <tt>CC</tt> compiler I found several times that a problematic code construct starts working in isolation.
    Returning to the <tt>std::vector<bool></tt> issue I found that putting the implementation from stdcxx 4.3.0 works. Thus one needs to edit (or copy and fix) <tt>CC/Cstd/vector.SUNWCCh</tt> and <tt>CC/Cstd/vector.cc</tt> files
    I provide here the changes for impatient, as this is not a direct copy-paste (some macros in 4.3.0 need changing to their 2.2.1 (i.e. libCstd) equivalents)
    In <tt>vector.SUNWCCh</tt> file replace vector<bool>specialization with
    #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
    template <class _Allocator>
    class
    #else   // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
         // use a macro to mutate _Allocator into allocator<bool>
    # define _Allocator allocator<bool>
    _RWSTD_TEMPLATE
    class _RWSTDExport
    #endif  // _RWSTD_NO_CLASS_PARTIAL_SPEC
    vector<bool, _Allocator >: private _Allocator
        typedef _RWSTD_REBIND(_Allocator, unsigned int)       _C_value_alloc_type;
        typedef vector                                        _C_self;
    public:
        typedef _Allocator                                      allocator_type;
        typedef bool                                            value_type;
        typedef _TYPENAME allocator_type::size_type             size_type;
        typedef _TYPENAME allocator_type::difference_type       difference_type;
        typedef _TYPENAME _C_value_alloc_type::pointer          pointer;
        typedef _TYPENAME _C_value_alloc_type::const_pointer    const_pointer;
        class iterator;
        class const_iterator;
        class reference {
    #if !defined (__INTEL_COMPILER) || !defined (_MSC_VER)
            // avoid MSVC 6.0 bug 576
            friend class iterator;
    #else   // if Intel C++ 8.1 with MSVC
            // work around Intel C++ 8.1 bug 575
            friend class _C_self::iterator;
    #endif   // Intel C++ with MSVC
            friend class const_iterator;
        private:
            unsigned int* _C_p;
            unsigned int _C_mask;
            reference (unsigned int* __x, unsigned int __y)
                : _C_p (__x), _C_mask (__y) { }
        public:
            reference () : _C_p (), _C_mask () {}
            operator bool () const {
                return !!(*_C_p & _C_mask);
            reference& operator= (bool __x) {
                if (__x)     
                    *_C_p |= _C_mask;
                else
                    *_C_p &= ~_C_mask;
                return *this;
            reference& operator= (const reference& __x) {
                return *this = bool(__x);
    #ifndef _RWSTD_STRICT_ANSI
          bool operator== (const reference& __x) const {
              return bool(*this) == bool(__x);
          bool operator< (const reference& __x) const {
    #ifndef _MSC_VER
              return bool(*this) < bool(__x);
    #else
              return int(*this) < int(__x);
    #endif
            bool operator!= (const reference& __x) const {
                return !(*this == __x);
            bool operator> (const reference& __x) const {
                return  __x < *this;
            bool operator>= (const reference& __x) const {
                return !(*this < __x);
            bool operator<= (const reference& __x) const {
                return !(*this > __x);
    #endif // _RWSTD_STRICT_ANSI
            void flip () {
                *_C_p ^= _C_mask;
        typedef bool const_reference;
        // hacks working around bogus g++ 2.95.2 warnings coming out of
        // iterators below as well as what's probably an MSVC 6.0 bug
        typedef reference       _C_ref;
        typedef const_reference _C_const_ref;
        typedef difference_type _C_diff_t;
        class _C_iter {
            friend class iterator;
            friend class const_iterator;
        private:
    #if defined (__GNUG__)
            // gcc 3.0.1 and prior take 14.5.3, p9 literally
        public:
    #elif    defined (_MSC_VER) && _MSC_VER <= 1300 || defined (__APOGEE__)
            friend class vector<bool, _Allocator>;
    #else
            friend class vector;
    #endif
            unsigned int* _C_p;        // pointer to the current word
            unsigned int  _C_offset;   // number of the pointed-to bit
            _C_iter (unsigned int* __x = 0, unsigned int __y = 0)
                : _C_p (__x), _C_offset (__y) { }
            // On Sun, gcc 3.1 does generate an incorrect copy constructor
            // that has as an effect an incompletely/incorrectly initialized
            // iterator.
    #if    defined (__sun__) && defined (__GNUG__) \
        || defined (__SUNPRO_CC) && defined (__amd64__)
            // working around a gcc 3.1 bug on Solaris where the compiler
            // generates bad code for the implicitly defined copy ctor
            // also working around a Sun C++ 5.9 optimizer ICE on x86_64
            // in wide (64-bit) mode (see STDCXX-551)
            _C_iter (const _C_iter& __it)
                : _C_p (__it._C_p), _C_offset (__it._C_offset) {}
    #endif   // gcc 3.1/Solaris || Sun C++ 5.9/x86_64
            void operator++ () {
                if (_C_offset++ == _RWSTD_WORD_BIT - 1) {
                    _C_offset = 0;
                    ++_C_p;
            void operator-- () {
                if (_C_offset-- == 0) {
                    _C_offset = _RWSTD_WORD_BIT - 1;
                    --_C_p;
            void operator+= (difference_type __i) {
                difference_type __n = __i + _C_offset;
                _C_p += __n / _RWSTD_WORD_BIT;
                __n = __n % _RWSTD_WORD_BIT;
                if (__n < 0) {
                    _C_offset = _RWSTD_STATIC_CAST (unsigned int,
                                                    __n + _RWSTD_WORD_BIT);
                    --_C_p;
                else
                    _C_offset = _RWSTD_STATIC_CAST (unsigned int,__n);
        public:
            bool operator== (const _C_iter& __x) const {
                return _C_p == __x._C_p && _C_offset == __x._C_offset;
            bool operator< (const _C_iter& __x) const {
                return _C_p < __x._C_p ||
                    (_C_p == __x._C_p && _C_offset < __x._C_offset);
            bool operator!= (const _C_iter& __x) const {
                return !(*this == __x);
            bool operator> (const _C_iter& __x) const {
                return __x < *this;
            bool operator>= (const _C_iter& __x) const {
                return !(*this < __x);
            bool operator<= (const _C_iter& __x) const {
                return !(*this > __x);
        class iterator
            : public _C_iter,
              public _RW_STD::iterator<random_access_iterator_tag,
                                       value_type, _C_diff_t,
                                       pointer, _C_ref> {
        public:
            // bring names used in declarations below into scope
            // (dependent base members not visible without qualification)
            typedef _C_ref    reference;
            typedef _C_diff_t difference_type;
            iterator (unsigned int *__x = 0, unsigned int __y = 0)
                : _C_iter (__x, __y) { }
            reference operator* () const {
                return reference (this->_C_p, 1U << this->_C_offset);
            iterator& operator++ () {
                return _C_iter::operator++(), *this;
            iterator operator++ (int) {
                iterator __tmp = *this;
                ++*this;
                return __tmp;
            iterator& operator-- () {
                return _C_iter::operator--(), *this;
            iterator operator-- (int) {
                iterator __tmp = *this;
                --*this;
                return __tmp;
            iterator& operator+= (difference_type __i) {
                return _C_iter::operator+= (__i), *this;
            iterator& operator-= (difference_type __i) {
                *this += -__i;
                return *this;
            iterator operator+ (difference_type __i) const {
                iterator __tmp = *this;
                return __tmp += __i;
            iterator operator- (difference_type __i) const {
                iterator __tmp = *this;
                return __tmp -= __i;
            difference_type operator- (iterator __x) const {
                return   _RWSTD_WORD_BIT * (this->_C_p - __x._C_p)
                       + this->_C_offset - __x._C_offset;
            reference operator[] (difference_type __i) {
                return *(*this + __i);
            friend iterator operator+ (difference_type __i,
                                       const iterator &__x) {
                return __x + __i;
        class const_iterator
            : public _C_iter,
              public _RW_STD::iterator<random_access_iterator_tag,
                                       value_type, _C_diff_t,
                                       const_pointer, _C_const_ref> {
        public:
            // bring names used in declarations below into scope
            // (dependent base members not visible without qualification)
            typedef _C_const_ref const_reference;
            typedef _C_diff_t    difference_type;
            const_iterator (unsigned int *__x = 0, unsigned int __y = 0)
                : _C_iter (__x, __y) { }
            const_iterator (const _C_iter &__x)
                : _C_iter (__x) { }
            const_reference operator* () const {
                return _C_ref (this->_C_p, 1U << this->_C_offset);
            const_iterator& operator++ () {
                return _C_iter::operator++(), *this;
            const_iterator operator++ (int) {
                const_iterator __tmp = *this;
                ++*this;
                return __tmp;
            const_iterator& operator-- () {
                return _C_iter::operator--(), *this;
            const_iterator operator-- (int) {
                const_iterator __tmp = *this;
                --*this;
                return __tmp;
            const_iterator& operator+= (difference_type __i) {
                return _C_iter::operator+= (__i), *this;
            const_iterator& operator-= (difference_type __i) {
                return *this += -__i;
            const_iterator
            operator+ (difference_type __i) const {
                return const_iterator (*this) += __i;
            const_iterator operator- (difference_type __i) const {
                return const_iterator (*this) -= __i;
            difference_type operator- (const_iterator __x) const {
                return   _RWSTD_WORD_BIT * (this->_C_p - __x._C_p)
                       + this->_C_offset - __x._C_offset;
            const_reference operator[] (difference_type __i) {
                return *(*this + __i);
            friend const_iterator operator+ (difference_type __i,
                                             const const_iterator &__x) {
                return __x + __i;
    #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
        typedef _RW_STD::reverse_iterator<const_iterator> const_reverse_iterator;
        typedef _RW_STD::reverse_iterator<iterator>       reverse_iterator;
    #else
        typedef _RW_STD::reverse_iterator<const_iterator,
            random_access_iterator_tag, value_type,
            const_reference, const_pointer, difference_type>
        const_reverse_iterator;
        typedef _RW_STD::reverse_iterator<iterator,
            random_access_iterator_tag, value_type,
            reference, pointer, difference_type>
        reverse_iterator;
    #endif   // _RWSTD_NO_CLASS_PARTIAL_SPEC
      private:
        // These private functions are replicas of generic algorithms.
        //  We provide them here to avoid putting instantiations of
        //  the generic algorithms into an archive or shared library.
        //  This gives you full flexibilty in deciding where you want
        //  to put particular instantiations of the generic
        //  algorithms.
        void _C_fill (iterator __first, iterator __last, bool __val) {
            while (__first != __last) *__first++ = __val;
        void _C_fill_n (iterator __first, size_type __n, bool __val) {
            while (__n-- > 0) *__first++ = __val;
        template <class _Iterator>
        iterator _C_copy (_Iterator __first, _Iterator __last, iterator __res) {
            while (__first != __last)
                *__res++ = *__first++;
            return __res;
        template <class _Iterator>
        iterator
        _C_copy_backward (_Iterator __first, _Iterator __last, iterator __res) {
            while (__first != __last) *--__res = *--__last;
            return __res;
    private:
        iterator       _C_begin;
        iterator       _C_end;
        unsigned int * _C_bufend;
        unsigned int* _C_bit_alloc (size_type __n) {
            return _C_value_alloc_type(*this).
                allocate ((__n + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT,
                          pointer(_C_begin._C_p));
        void _C_init (size_type __n) {
            unsigned int* __q = _C_bit_alloc(__n);
            _C_bufend = __q + (__n + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT;
            _C_begin  = iterator(__q, 0);
            _C_end    = _C_begin + __n;
        void _C_insert (iterator, bool);
    public:
        vector (const _Allocator&  __alloc = allocator_type ())
            : allocator_type (__alloc), _C_begin(iterator()), _C_end(iterator()),
            _C_bufend () { }
    #if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530
        // working around a SunPro 5.3 bug (see PR #25962)
        explicit
    #endif   // SunPro > 5.3
        vector (size_type __n, bool __val = bool (),
           const _Allocator&  __alloc = allocator_type ())
            : allocator_type (__alloc), _C_bufend () {
          _C_init(__n);
          unsigned int * __first = _C_begin._C_p;
          size_type __m = (__n + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT;
          while (__m-- > 0) *__first++ = __val ? ~0 : 0;
        vector (const _C_self &__x)
            : allocator_type (__x.get_allocator ()), _C_bufend  () {
            _C_init (__x.size ());
            _C_copy (__x.begin (), __x.end (), _C_begin);
        template<class _InputIter>
        vector  (_InputIter __first, _InputIter __last)
            : allocator_type (), _C_bufend ()
          size_type __n;
          distance(__first, __last, n);
          _C_init(__n);
          _C_copy(__first, __last, _C_begin);
        ~vector () {
          _C_value_alloc_type(*this).deallocate(_C_begin._C_p, 
            _C_bufend - _C_begin._C_p);
        _C_self& operator= (const _C_self& __x)
          if (&__x == this) return *this;
          if (__x.size() > capacity())
            _C_value_alloc_type(*this).deallocate(_C_begin._C_p,
              _C_bufend - _C_begin._C_p);
            _C_init(__x.size());
          _C_copy(__x.begin(), __x.end(), begin());
          _C_end = begin() + __x.size();
          return *this;
        template<class _InputIter>
        void assign (_InputIter __first, _InputIter __last) {
            clear ();
            insert (begin (), __first, __last);
        void assign (size_type __n, const bool& __x = bool()) {
            clear ();
            insert (begin (), __n, __x);
        allocator_type get_allocator() const {
          return *this;
        // iterators
        iterator       begin ()       { return _C_begin; }
        const_iterator begin () const
        { return const_iterator(_C_begin._C_p,_C_begin._C_offset); }
        iterator       end   ()       { return _C_end; }
        const_iterator end   () const
        { return const_iterator(_C_end._C_p,_C_end._C_offset); }
        reverse_iterator       rbegin () { return reverse_iterator(end()); }
        const_reverse_iterator rbegin () const
          return const_reverse_iterator(end());
        reverse_iterator       rend () { return reverse_iterator(begin()); }
        const_reverse_iterator rend () const
          return const_reverse_iterator(begin());
        // capacity
        size_type size     () const { return size_type(end() - begin());  }
        size_type max_size () const {
            return _C_value_alloc_type(*this).max_size();
        void resize (size_type __new_size, bool __c = false);
        size_type capacity () const
          return size_type(const_iterator(_C_bufend, 0) - begin());
        bool empty () const { return begin() == end(); }
        void reserve (size_type __n)
            _RWSTD_THROW(__n > max_size(), length_error,
              __RWSTD::except_msg_string(__RWSTD::__rwse_InvalidSizeParam,
                "vector<bool>::reserve(size_type)",__n,max_size()).msgstr());
          if (capacity() < __n)
            unsigned int* __q = _C_bit_alloc(__n);
            _C_end = _C_copy(begin(), end(), iterator(__q, 0));
            _C_value_alloc_type(*this).deallocate(_C_begin._C_p,
                                                 _C_bufend - _C_begin._C_p);
            _C_begin = iterator(__q, 0);
            _C_bufend = __q + (__n + _RWSTD_WORD_BIT - 1)/_RWSTD_WORD_BIT;
        // element access
        reference       operator[] (size_type __n)      
    #ifdef _RWSTD_BOUNDS_CHECKING
            _RWSTD_THROW(__n >= size(), out_of_range,
              __RWSTD::except_msg_string(__RWSTD::rwse_OutOfRange,
                "vector<bool>::[](size_type)", __n, size()).msgstr());
    #endif   // _RWSTD_BOUNDS_CHECKING
          return *(begin() + __n);
        const_reference operator[] (size_type __n) const
    #ifdef _RWSTD_BOUNDS_CHECKING
            _RWSTD_THROW(__n >= size(), out_of_range,
              __RWSTD::except_msg_string(__RWSTD::rwse_OutOfRange,
                "vector<bool>::[](size_type) const", __n, size()).msgstr());
    #endif   // _RWSTD_BOUNDS_CHECKING
          return *(begin() + __n);
        reference       at (size_type __n)              
            _RWSTD_THROW(__n >= size(), out_of_range,
              __RWSTD::except_msg_string(__RWSTD::rwse_OutOfRange,
                "vector<bool>::at(size_type)", __n, size ()).msgstr());
          return *(begin() + __n);
        const_reference at (size_type __n) const
            _RWSTD_THROW(__n >= size(), out_of_range,
              __RWSTD::except_msg_string(__RWSTD::rwse_OutOfRange,
                "vector<bool>::at(size_type) const", __n, size()).msgstr());
          return *(begin() + __n);
        reference       front ()       { return *begin();     }
        const_reference front () const { return *begin();     }
        reference       back  ()       { return *(end() - 1); }
        const_reference back  () const { return *(end() - 1); }
        // modifiers
        void push_back (const bool& __x)
            if (_C_end._C_p != _C_bufend) {
                ++_C_end;
                *(_C_end-1) = __x;
            else
                _C_insert(end(), __x);
        void pop_back () { --_C_end; }
        iterator insert (iterator __it, const bool& __x = bool())
          size_type __n = __it - begin();
          if (_C_end._C_p != _C_bufend && __it == end()) {
              ++_C_end;
              *(_C_end-1) = __x;
          else
            _C_insert(__it, __x);
          return begin() + __n;
        void insert (iterator __it, size_type __n, const bool& __x);
        template<class _InputIter>
        void insert (iterator __it, _InputIter __first,
                     _InputIter __last);
        iterator erase (iterator __it)
          if (!(__it + 1 == end()))
            _C_copy(__it + 1, end(), __it);
          --_C_end;
          return __it;
        iterator erase(iterator __first, iterator __last)
          _C_end = _C_copy(__last, end(), __first);
          return __first;
        void swap (_C_self& __x)
          if((_C_value_alloc_type)*this == (_C_value_alloc_type)__x)
            _STD::swap (_C_begin,  __x._C_begin);
            _STD::swap (_C_end,    __x._C_end);
            _STD::swap (_C_bufend, __x._C_bufend);
          else
            _C_self _x = *this;
            *this = __x;
            __x=_x;
        static void swap(reference __x, reference __y);
        void flip ();
        void clear()
          erase(begin(),end());
    #if defined (_RWSTD_NO_PART_SPEC_OVERLOAD)
        friend void swap (vector& __lhs, vector& __rhs) {
            __lhs.swap (__rhs);
    #endif
    #undef _Allocatorto be continued in the next post, whole text exceeds 30k characters :)

Maybe you are looking for

  • Need help with fillable pdf to be made into e-book format

    I have made a fillable pdf form using livecycle. I want this form to be used an an e-book. I have contacted kindle and they advised they can't a pdf file from me and it needs to be in html or microsoft word format. How can i convert my pdf form to a

  • What is the procedure to set the NLS_DATE_FORMAt in the database?

    what is the procedure to set the NLS_DATE_FORMAt in the database?

  • Mystery slot in my computer

    Ok..this is probably a dumb questions, but can anybody tell me what that slot is for at the left side of my MacBook Pro? There seems to be a slot that I can push in (beside headphone jack) but I have no idea what "goes there"...anyone want to help a

  • IMac 400 MHz G3 DV - DVD Firmware

    Hi, I got hands on a : iMac 400 MHz DV (G3 - M5521) PowerMac2,1 (PowerPC 750) Order No. M7493LL/A* EMC: 1821 DHHS: LA ATI Rage 128VR (2D/3D) AGP 2x (8MB VRAM) Date Oct. 5, 1999 Disc Date July 19, 2000 I already updated the firmware to 4.1.9 and insta

  • Does PopUpManager "close" event remove PopUp from memory?

    I'm using a lot of popup windows (in addition to tooltips) in an application.  Does the PopUpManager's close event remove the popup from memory?  If not, I'd like to find out how this could be done. Thanks.