473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

confused about generics and abstract classes

Hello,

I probably don't see the obvious, but maybe you can help me out of this
mess.

The following is my problem:
I created two classes NormDistribution and DiscDistribution. Both
classes provide an implemation of the operator +.

Now I want to write another generic class Plan<DType>, which can
accept NormDistribution and DiscDistribution for DType. And here comes
my problem. Class Plan must have a function like this:

public class Plan<DType>
{
public DType Demand1;
public DType Demand2;
public DType Demand3;

public void Optimize()
{
Demand3 = Demand1 + Demand2; // <- error CS0019
}
}

How can I solve the problem?
The background for this is, that my class Plan does some computations,
which are independant of the underling distribution type. The
computation differ only in the implementation of the basic operators +,
- and so on. I wanted to delegate the problem to the NormDistribtution
and DiscDistribution class, but somehow I can not get it to work.

Any ideas?

Thanks,
Sascha

May 10 '06 #1
11 2459
On 9 May 2006 02:05:07 -0700, he*****@wiso.uni-koeln.de wrote:
The following is my problem:
I created two classes NormDistribution and DiscDistribution. Both
classes provide an implemation of the operator +.


Judging from your code, it looks as if you expected .NET/C# generics
to work like C++ generics -- but they don't. They use run-time
instantiation, not compile-time instantiation as in C++, so that they
can be used from different assemblies than the one they're defined in.

For this reason, it doesn't matter whether your _concrete_ types
define some method. Your _type argument_ must declare any methods
that you want to use in the generic class or method, via constraints.

And even so, you won't be able to use operators at all because .NET
generics do not currently accept operator restraints. You must define
a regular method for addition instead.

No offense, but I suggest you pick up the MSDN Library or a good book
(see my website) and read up on how .NET generics work. There's a lot
of gotchas for people who are used to C++ generics. Jeff Richter's
"CLR via C#" covers everything you need to know in this regard.
--
http://www.kynosarges.de
May 10 '06 #2

<he*****@wiso.uni-koeln.de> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
Hello,

I probably don't see the obvious, but maybe you can help me out of this
mess.

The following is my problem:
I created two classes NormDistribution and DiscDistribution. Both
classes provide an implemation of the operator +.

Now I want to write another generic class Plan<DType>, which can
accept NormDistribution and DiscDistribution for DType. And here comes
my problem. Class Plan must have a function like this:

public class Plan<DType>
{
public DType Demand1;
public DType Demand2;
public DType Demand3;

public void Optimize()
{
Demand3 = Demand1 + Demand2; // <- error CS0019
}
}

How can I solve the problem?
The background for this is, that my class Plan does some computations,
which are independant of the underling distribution type. The
computation differ only in the implementation of the basic operators +,
- and so on. I wanted to delegate the problem to the NormDistribtution
and DiscDistribution class, but somehow I can not get it to work.

Any ideas?

Thanks,
Sascha


1) Either have your distribution classes derive from a common base or
implement a common interface (Let's call it "Common" either way).
2) Give Common an "public Common Add(Common other)" method
3) Force DType to be derived from (or implement) Common: "public class
Plan<DType> where DType: Common {...."
4) Demand3 = Demand1.Add(Demand2);

This isn't really satisfactory because you might as well forget about
generics and just work with "Common" using plain old polymorphism.

As Chris pointed out - even ignoring the issue of operators or methods you
cannot do the usual C++ stuff.

eg you cannot inject methods into a derived class with:

public class DiscDistribution : IAddable<DiscDistribution>

May 10 '06 #3
1000 apologies - I was thinking of "class C<T> : T" or "C<A,B> : A<B>".

Your other post is indeed the way to go and the way that you would do
something similar in C++

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:ur**************@TK2MSFTNGP02.phx.gbl...
Nick,
| eg you cannot inject methods into a derived class with:
| public class DiscDistribution : IAddable<DiscDistribution>
Umm... Yes you can!

Try:

public interface IAddable<T>
{
T Add(T other);
}

public class DiscDistribution : IAddable<DiscDistribution>
{
public DiscDistribution Add(DiscDistribution other)
{
return null;
}
}

I use the above with IEquatable<T> all the time!
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
news:1V********************@fe2.news.blueyonder.co .uk...
|
| <he*****@wiso.uni-koeln.de> wrote in message
| news:11*********************@y43g2000cwc.googlegro ups.com...
| > Hello,
| >
| > I probably don't see the obvious, but maybe you can help me out of
this
| > mess.
| >
| > The following is my problem:
| > I created two classes NormDistribution and DiscDistribution. Both
| > classes provide an implemation of the operator +.
| >
| > Now I want to write another generic class Plan<DType>, which can
| > accept NormDistribution and DiscDistribution for DType. And here comes
| > my problem. Class Plan must have a function like this:
| >
| > public class Plan<DType>
| > {
| > public DType Demand1;
| > public DType Demand2;
| > public DType Demand3;
| >
| > public void Optimize()
| > {
| > Demand3 = Demand1 + Demand2; // <- error CS0019
| > }
| > }
| >
| > How can I solve the problem?
| > The background for this is, that my class Plan does some computations,
| > which are independant of the underling distribution type. The
| > computation differ only in the implementation of the basic operators
+,
| > - and so on. I wanted to delegate the problem to the NormDistribtution
| > and DiscDistribution class, but somehow I can not get it to work.
| >
| > Any ideas?
| >
| > Thanks,
| > Sascha
| >
|
| 1) Either have your distribution classes derive from a common base or
| implement a common interface (Let's call it "Common" either way).
| 2) Give Common an "public Common Add(Common other)" method
| 3) Force DType to be derived from (or implement) Common: "public class
| Plan<DType> where DType: Common {...."
| 4) Demand3 = Demand1.Add(Demand2);
|
| This isn't really satisfactory because you might as well forget about
| generics and just work with "Common" using plain old polymorphism.
|
| As Chris pointed out - even ignoring the issue of operators or methods
you
| cannot do the usual C++ stuff.
|
| eg you cannot inject methods into a derived class with:
|
| public class DiscDistribution : IAddable<DiscDistribution>
|
|
|

May 10 '06 #4
| 1000 apologies
Accepted, although I'm really offended!

| I was thinking of "class C<T> : T"

Correct:

Although the first time I saw "class C : B<C>" where B is a base class, I
scratched my head. As I think of the "C<T> : T" case... Which I find odd as
I follow the "class C : I<C>" without any problems...

| or "C<A,B> : A<B>".
This is allowed! ;-)

class A<T>
{
}

class B
{
}

class C<A,B> : A<B>
{
}

C<object, IEquatable<object>> x = new
C<object,IEquatable<object>>();

Depending on what you use for A & B, they could even be the same type, such
as:

class X : IEquatable<X>
{
public bool Equals(X other)
{
return false;
}
}

C<X, X> x = new C<X,X>();

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
news:u8******************@fe2.news.blueyonder.co.u k...
| 1000 apologies - I was thinking of "class C<T> : T" or "C<A,B> : A<B>".
|
| Your other post is indeed the way to go and the way that you would do
| something similar in C++
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:ur**************@TK2MSFTNGP02.phx.gbl...
| > Nick,
| > | eg you cannot inject methods into a derived class with:
| > | public class DiscDistribution : IAddable<DiscDistribution>
| > Umm... Yes you can!
| >
| > Try:
| >
| > public interface IAddable<T>
| > {
| > T Add(T other);
| > }
| >
| > public class DiscDistribution : IAddable<DiscDistribution>
| > {
| > public DiscDistribution Add(DiscDistribution other)
| > {
| > return null;
| > }
| > }
| >
| > I use the above with IEquatable<T> all the time!
| >
| >
| > --
| > Hope this helps
| > Jay B. Harlow [MVP - Outlook]
| > .NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
| > news:1V********************@fe2.news.blueyonder.co .uk...
| > |
| > | <he*****@wiso.uni-koeln.de> wrote in message
| > | news:11*********************@y43g2000cwc.googlegro ups.com...
| > | > Hello,
| > | >
| > | > I probably don't see the obvious, but maybe you can help me out of
| > this
| > | > mess.
| > | >
| > | > The following is my problem:
| > | > I created two classes NormDistribution and DiscDistribution. Both
| > | > classes provide an implemation of the operator +.
| > | >
| > | > Now I want to write another generic class Plan<DType>, which can
| > | > accept NormDistribution and DiscDistribution for DType. And here
comes
| > | > my problem. Class Plan must have a function like this:
| > | >
| > | > public class Plan<DType>
| > | > {
| > | > public DType Demand1;
| > | > public DType Demand2;
| > | > public DType Demand3;
| > | >
| > | > public void Optimize()
| > | > {
| > | > Demand3 = Demand1 + Demand2; // <- error CS0019
| > | > }
| > | > }
| > | >
| > | > How can I solve the problem?
| > | > The background for this is, that my class Plan does some
computations,
| > | > which are independant of the underling distribution type. The
| > | > computation differ only in the implementation of the basic operators
| > +,
| > | > - and so on. I wanted to delegate the problem to the
NormDistribtution
| > | > and DiscDistribution class, but somehow I can not get it to work.
| > | >
| > | > Any ideas?
| > | >
| > | > Thanks,
| > | > Sascha
| > | >
| > |
| > | 1) Either have your distribution classes derive from a common base or
| > | implement a common interface (Let's call it "Common" either way).
| > | 2) Give Common an "public Common Add(Common other)" method
| > | 3) Force DType to be derived from (or implement) Common: "public class
| > | Plan<DType> where DType: Common {...."
| > | 4) Demand3 = Demand1.Add(Demand2);
| > |
| > | This isn't really satisfactory because you might as well forget about
| > | generics and just work with "Common" using plain old polymorphism.
| > |
| > | As Chris pointed out - even ignoring the issue of operators or methods
| > you
| > | cannot do the usual C++ stuff.
| > |
| > | eg you cannot inject methods into a derived class with:
| > |
| > | public class DiscDistribution : IAddable<DiscDistribution>
| > |
| > |
| > |
| >
| >
|
|
May 10 '06 #5

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:ul**************@TK2MSFTNGP05.phx.gbl...
| 1000 apologies
Accepted, although I'm really offended!

| I was thinking of "class C<T> : T"

Correct:

Although the first time I saw "class C : B<C>" where B is a base class, I
scratched my head. As I think of the "C<T> : T" case... Which I find odd
as
I follow the "class C : I<C>" without any problems...

| or "C<A,B> : A<B>".
This is allowed! ;-)


I obviously haven't woken up yet!

Maybe I should quit for the day but.....

Contradict me on this then:

Although you can have "C : IAddable<C>" it's still not as useful as C++
templates because you can't have "C : Addable<C>" with an actual
implementation of the addition as you can with C++ rel_ops say.
May 10 '06 #6
|| 1000 apologies
| Accepted, although I'm really offended!

Doh! Double Doh!

I meant to say:

Accepted, although I'm really *NOT* offended!
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:ul**************@TK2MSFTNGP05.phx.gbl...
|| 1000 apologies
| Accepted, although I'm really offended!
|
|| I was thinking of "class C<T> : T"
|
| Correct:
|
| Although the first time I saw "class C : B<C>" where B is a base class, I
| scratched my head. As I think of the "C<T> : T" case... Which I find odd
as
| I follow the "class C : I<C>" without any problems...
|
|| or "C<A,B> : A<B>".
| This is allowed! ;-)
|
| class A<T>
| {
| }
|
| class B
| {
| }
|
| class C<A,B> : A<B>
| {
| }
|
| C<object, IEquatable<object>> x = new
| C<object,IEquatable<object>>();
|
| Depending on what you use for A & B, they could even be the same type,
such
| as:
|
| class X : IEquatable<X>
| {
| public bool Equals(X other)
| {
| return false;
| }
| }
|
| C<X, X> x = new C<X,X>();
|
|
|
| --
| Hope this helps
| Jay B. Harlow [MVP - Outlook]
| .NET Application Architect, Enthusiast, & Evangelist
| T.S. Bradley - http://www.tsbradley.net
|
|
| "Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
| news:u8******************@fe2.news.blueyonder.co.u k...
|| 1000 apologies - I was thinking of "class C<T> : T" or "C<A,B> : A<B>".
||
|| Your other post is indeed the way to go and the way that you would do
|| something similar in C++
||
|| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
|| message news:ur**************@TK2MSFTNGP02.phx.gbl...
|| > Nick,
|| > | eg you cannot inject methods into a derived class with:
|| > | public class DiscDistribution : IAddable<DiscDistribution>
|| > Umm... Yes you can!
|| >
|| > Try:
|| >
|| > public interface IAddable<T>
|| > {
|| > T Add(T other);
|| > }
|| >
|| > public class DiscDistribution : IAddable<DiscDistribution>
|| > {
|| > public DiscDistribution Add(DiscDistribution other)
|| > {
|| > return null;
|| > }
|| > }
|| >
|| > I use the above with IEquatable<T> all the time!
|| >
|| >
|| > --
|| > Hope this helps
|| > Jay B. Harlow [MVP - Outlook]
|| > .NET Application Architect, Enthusiast, & Evangelist
|| > T.S. Bradley - http://www.tsbradley.net
|| >
|| >
|| > "Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
|| > news:1V********************@fe2.news.blueyonder.co .uk...
|| > |
|| > | <he*****@wiso.uni-koeln.de> wrote in message
|| > | news:11*********************@y43g2000cwc.googlegro ups.com...
|| > | > Hello,
|| > | >
|| > | > I probably don't see the obvious, but maybe you can help me out of
|| > this
|| > | > mess.
|| > | >
|| > | > The following is my problem:
|| > | > I created two classes NormDistribution and DiscDistribution. Both
|| > | > classes provide an implemation of the operator +.
|| > | >
|| > | > Now I want to write another generic class Plan<DType>, which can
|| > | > accept NormDistribution and DiscDistribution for DType. And here
| comes
|| > | > my problem. Class Plan must have a function like this:
|| > | >
|| > | > public class Plan<DType>
|| > | > {
|| > | > public DType Demand1;
|| > | > public DType Demand2;
|| > | > public DType Demand3;
|| > | >
|| > | > public void Optimize()
|| > | > {
|| > | > Demand3 = Demand1 + Demand2; // <- error CS0019
|| > | > }
|| > | > }
|| > | >
|| > | > How can I solve the problem?
|| > | > The background for this is, that my class Plan does some
| computations,
|| > | > which are independant of the underling distribution type. The
|| > | > computation differ only in the implementation of the basic
operators
|| > +,
|| > | > - and so on. I wanted to delegate the problem to the
| NormDistribtution
|| > | > and DiscDistribution class, but somehow I can not get it to work.
|| > | >
|| > | > Any ideas?
|| > | >
|| > | > Thanks,
|| > | > Sascha
|| > | >
|| > |
|| > | 1) Either have your distribution classes derive from a common base or
|| > | implement a common interface (Let's call it "Common" either way).
|| > | 2) Give Common an "public Common Add(Common other)" method
|| > | 3) Force DType to be derived from (or implement) Common: "public
class
|| > | Plan<DType> where DType: Common {...."
|| > | 4) Demand3 = Demand1.Add(Demand2);
|| > |
|| > | This isn't really satisfactory because you might as well forget about
|| > | generics and just work with "Common" using plain old polymorphism.
|| > |
|| > | As Chris pointed out - even ignoring the issue of operators or
methods
|| > you
|| > | cannot do the usual C++ stuff.
|| > |
|| > | eg you cannot inject methods into a derived class with:
|| > |
|| > | public class DiscDistribution : IAddable<DiscDistribution>
|| > |
|| > |
|| > |
|| >
|| >
||
||
|
|
May 11 '06 #7
Hi everybody,

thanks for all the good answers. Even though I know my way around in
c/c++ I feel like a beginner in c#. I think about your soloutions and
will implement them.

Thanks,
Sascha

May 11 '06 #8
Nick,
I not suggesting that Generics are "As useful" as C++ templates. I don't
believe I suggested anything either way. Now that you bring it up; my
feeling is: Although Generics are missing some features, most notably for me
operator constraints, I think Generics have learned from the mistakes of
templates & have a stronger implementation. Although I do find it extremely
handy in C++/CLI to be able to use both templates & generics in a solution;
including templated generic classes & generic templated classes. IMHO the
problem domain of templates & the problem domain of generics although
largely overlapping does not wholly contain each other! Remember Generics
are a runtime feature trying to solve a runtime problem, while Templates are
a compile time feature not concerned with the runtime problem. The generic
type itself is expanded once by the compiler into its assembly. Users of the
generic template simply refer to this assembly. The runtime will example the
generic type itself as needed. Templates get expanded into each assembly
meaning that a templated Nullable<Int32> in assembly one is a distinct type
from a template Nullable<Int32> in assembly two.

FWIW: I'm very curios on how the "operator constraint" problem will be
solved as IMHO its not as simply as it appears, some types (Int32) use
specific IL opcodes for each operator, while other types (Decimal) use
operator overloading. Currently the compiler itself decides to use an opcode
or call the specific method. This won't work per se with generics as a
generic type is compiled once into an assembly...

| Although you can have "C : IAddable<C>" it's still not as useful as C++
| templates because you can't have "C : Addable<C>" with an actual
| implementation of the addition as you can with C++ rel_ops say.
I take it you mean something like:

class Addable<T>
{
public static Addable<T> operator +(Addable<T> lhs, Addable<T>
rhs)
{
return ...;
}
public static T operator +(T lhs, T rhs)
{
return ...;
}
}

I'm not seeing a solution without an implicit conversion being defined. The
first operator above wants an implicit conversion defined, the second wants
one of the parameters to be Addable<T>.

You can define conversion operators in a generic type such as Addable<T>
(Nullable<T> uses them):

public static implicit operator T(Addable<T> other)
{
return default(T);
}

However in the above example I then get a CS0457 "Ambiguous user defined
conversions" error.

FWIW: This is the code where I was using the above:

class C : Addable<C>
{
}

C x = new C();
C y = new C();
C z = x + y;

Unfortunately I am far from a Generic expert, I may be missing something
simple in the above to get it to work. If I have time later maybe I will
look at it more then.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
news:09*****************@text.news.blueyonder.co.u k...
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:ul**************@TK2MSFTNGP05.phx.gbl...
| >| 1000 apologies
| > Accepted, although I'm really offended!
| >
| > | I was thinking of "class C<T> : T"
| >
| > Correct:
| >
| > Although the first time I saw "class C : B<C>" where B is a base class,
I
| > scratched my head. As I think of the "C<T> : T" case... Which I find odd
| > as
| > I follow the "class C : I<C>" without any problems...
| >
| > | or "C<A,B> : A<B>".
| > This is allowed! ;-)
|
| I obviously haven't woken up yet!
|
| Maybe I should quit for the day but.....
|
| Contradict me on this then:
|
| Although you can have "C : IAddable<C>" it's still not as useful as C++
| templates because you can't have "C : Addable<C>" with an actual
| implementation of the addition as you can with C++ rel_ops say.
|
|
May 11 '06 #9
On Thu, 11 May 2006 07:45:38 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************@tsbradley.net> wrote:
FWIW: I'm very curios on how the "operator constraint" problem will be
solved as IMHO its not as simply as it appears, some types (Int32) use
specific IL opcodes for each operator, while other types (Decimal) use
operator overloading. Currently the compiler itself decides to use an opcode
or call the specific method. This won't work per se with generics as a
generic type is compiled once into an assembly...


That is true, and numerics are really the #1 reason for having
operator constraints in the first place. I think one of the related
entries in the MSDN Feedback Center suggests that the BCL provide a
special construct to express "type T is a numeric type" rather than a
general operator constraint. That's more useful in my opinion, but
then again I'm not a big fan of arbitrary operator overloading!
--
http://www.kynosarges.de
May 11 '06 #10
Op Thu, 11 May 2006 17:10:42 +0200 schreef Chris Nahr
<ch************@kynosarges.de>:
On Thu, 11 May 2006 07:45:38 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************@tsbradley.net> wrote:
FWIW: I'm very curios on how the "operator constraint" problem will be
solved as IMHO its not as simply as it appears, some types (Int32) use
specific IL opcodes for each operator, while other types (Decimal) use
operator overloading. Currently the compiler itself decides to use an
opcode
or call the specific method. This won't work per se with generics as a
generic type is compiled once into an assembly...


That is true, and numerics are really the #1 reason for having
operator constraints in the first place. I think one of the related
entries in the MSDN Feedback Center suggests that the BCL provide a
special construct to express "type T is a numeric type" rather than a
general operator constraint. That's more useful in my opinion, but
then again I'm not a big fan of arbitrary operator overloading!


they should make it possible to use operators in interfaces (can anyone
tell me why that is not possible?) so we can have an Inumeric or something
and let float/double/uint32 implement that.

i tried to use generics for a part of my 3d engine but i got frustrated
while using generics. now i'm implementing interpolation routines for each
type, something generics should prevent.

alwin
May 12 '06 #11
On Fri, 12 May 2006 15:51:30 +0200, alwin <al***@cs.nl> wrote:
they should make it possible to use operators in interfaces (can anyone
tell me why that is not possible?)


Yes. Operators are static methods, and interfaces only support
instance methods. There you have it.
--
http://www.kynosarges.de
May 12 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: f00sion | last post by:
I found a good tutorial of how to supply the objects without having the implementation files on the client. This was working great until I realized that I couldnt use any constructors with server...
8
by: Vishal Gandhi | last post by:
Hi , Please help me by advising an real life scenario where Abstract Classes should be used over Interfaces or vice versa . Whats the basic difference between Abstract Class and interface other...
12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
2
by: Joe Vrba | last post by:
I'm building a family of components derived from UserControl. There's an abstract base class to ensure basic functionality and then numerous other controls derived from that. The problem is...
2
by: Dave Veeneman | last post by:
Is is legal to declare abstract members in non-abstract classes? How about non-abstract members in abstract classes? I am writing a base class with three derived classes. The base class will...
3
by: WithPit | last post by:
I am trying to create an managed wrapper but have some problems with it by using abstract classes. In my unmanaged library code i had the following three classes with the following hierarchy ...
8
by: Manuel | last post by:
Hi! If I've a vector filled with abstract classes, can I push in it the derived classes too? Even if derived classes have new methods? I've done some experiments, and it seem I can push the...
4
by: Eric | last post by:
I was wondering what people thought about the information found at: http://g.oswego.edu/dl/mood/C++AsIDL.html Specifically, I am interested in the following recommendation: ---- Since...
6
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.