libfactory-bugs Mailing List for libfactory++
Status: Alpha
Brought to you by:
madduck
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: SourceForge.net <no...@so...> - 2004-06-04 16:40:53
|
Bugs item #966658, was opened at 2004-06-04 18:40 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=654088&aid=966658&group_id=109657 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: stephan beal (sgbeal) Assigned to: Nobody/Anonymous (nobody) Summary: unneeded create() overloads? Initial Comment: Regarding these create() overloads: template <typename _SubType> static inline _Type* create(_Key const& __KEY, Constructor<_SubType>& __constructor) { _Builder* __b = _S_registry().get_builder(__KEY); return (__b) ? __b->custom_build(__constructor) : 0; } template <typename _SubType> static inline _Type* create(_Key const& __KEY, Constructor<_SubType> const& __CONSTRUCTOR) { _Builder* __b = _S_registry().get_builder(__KEY); return (__b) ? __b->custom_build(__CONSTRUCTOR) : 0; } These seem to be completely unnecessary: If we KNOW in advance what ctor we're using, which we do in these cases, it seems to be unnecessary to call b->custom_build(ctor). Why not simply call the ctor directly? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=654088&aid=966658&group_id=109657 |
|
From: SourceForge.net <no...@so...> - 2004-06-04 16:38:49
|
Bugs item #966655, was opened at 2004-06-04 18:38 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=654088&aid=966655&group_id=109657 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: stephan beal (sgbeal) Assigned to: Nobody/Anonymous (nobody) Summary: Possible to pass bad types to create() Initial Comment: Factory::create(): static inline _Type* create(_Key const& __KEY, _Type const& __THAT) { _Builder* __b = _S_registry().get_builder(__KEY); return (__b) ? __b->build(__THAT) : 0; } Consider what happens here: A * a = create( "B", C ); Assuming types A --> B --> C, the above code would be invalid but would probably compile. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=654088&aid=966655&group_id=109657 |