Re: New draft LRM and progress

From: Alan Fitch <alan.fitch@doulos.com>
Date: Tue Nov 30 2010 - 05:29:44 PST

On 30/11/2010 13:08, Philipp A. Hartmann wrote:
> Alan,
>
> I'll try to answer the sc_vector related comments below.
>
> On 30/11/10 11:35, alan.fitch@doulos.com wrote:
>>
>> Section 9.5.7
>> What is the reason for
>>
>> "The value of the relation&V[i] + j ==&V[i + j] is undefined for all vectors v and for all indices i
>> and j."
>>

<snip explanation>

>
> But since std::vector gives this guarantee while sc_vector does not, I
> think it is important to include this restriction in the LRM.
>

OK, that makes sense.

>> p423
>> "Class sc_vector_assembly shall be copyable"
>> I don't have the C++ standard to hand - but does copyable always also mean "assignable"?
>
> Copyable does not include Assignable. I guess, supporting both would
> be Ok. Since sc_vector_assembly is not default-constructible, and more
> or less meant for rather short-lived expressions, I don't see a pressing
> need to support assignment explicitly, though.
>
> But at least Copyable is required, to make the binding adapters work.
> I think, we need to add an explicit copy-constructor to the class
> definition as well, as it is done for the other classes even if the
> compiler-generated ones suffice (c.f. sc_event_and_list).
>
> public:
> sc_vector_assembly( const sc_vector_assembly& );
>
> // optionally "private:" and disabled? or just public?
> sc_vector_assembly& operator=( const sc_vector_assembly );
>
> Also note, that the private constructor in sc_vector_assembly is not
> disabled (as it says in the LRM now) but rather implementation-defined,
> since sc_vector_assembly instances are meant to be created via the
> sc_assemble_vector function only. It should probably be dropped from
> the LRM.
>

OK, my question was partly prompted by noticing that sc_vector
explicitly disables operator= and the copy constructor, but
sc_vector_assembly doesn't - but sc_vector_assembly is said by the
standard to be copyable.

Thanks for the answers,

Alan

-- 
Alan Fitch
Senior Consultant
Doulos – Developing Design Know-how
VHDL * Verilog * SystemVerilog * SystemC * PSL * Perl * Tcl/Tk * Project 
Services
Doulos Ltd. Church Hatch, 22 Marketing Place, Ringwood, Hampshire, BH24 
1AW, UK
Tel:  + 44 (0)1425 471223		Email: alan.fitch@doulos.com	
Fax:  +44 (0)1425 471573		http://www.doulos.com
------------------------------------------------------------------------
This message may contain personal views which are not the views of 
Doulos, unless specifically stated.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Nov 30 05:30:30 2010

This archive was generated by hypermail 2.1.8 : Tue Nov 30 2010 - 05:30:32 PST