Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[OWBugzilla] [Bug 1162] missing default constructor results in "cannot construct object from argument" during template instantiation

0 views
Skip to first unread message

bugzill...@www.openwatcom.org

unread,
Mar 30, 2015, 7:54:45 AM3/30/15
to openwatco...@openwatcom.org
http://bugzilla.openwatcom.org/show_bug.cgi?id=1162


pch...@vtc.vsc.edu changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1




------- Comment #1 from pch...@vtc.vsc.edu 2015-03-30 03:54 PST8PDT -------
This arises because Open Watcom C++ does not yet implement the lazy
instantiation of class templates; instead all methods of a class template are
instantiated regardless of if they are needed or not.

A consequence of this is the type parameter to std::vector needs to be default
constructable. If it were not the case code such as the following would not
compile

std::vector<T> my_vector( 10 );

The above *requires* default constructability and Open Watcom can't have it
both ways at the moment. A fully standard compiler can have it both ways by not
instantiating the methods that aren't used, and one simply wouldn't write code
such as above for types without a default constructor.


--
Configure bugmail: http://bugzilla.openwatcom.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
0 new messages