Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional .NET 2.0 Generics
This is the forum to discuss the Wrox book Professional .NET 2.0 Generics by Tod Golding; ISBN: 9780764559884
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional .NET 2.0 Generics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 3rd, 2007, 01:31 PM
Registered User
 
Join Date: Feb 2007
Location: Sacramento, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Typographical error on page 51

This appears to be a typo, in both the downloadable sample code, and on page 51. The code in the ctor should test for inequality.

public class MySampleClass<T> {
    private static List<T> _values;

    static MySampleClass() {
        if (typeof(T).IsAbstract == false)
            throw new Exception("T must not be abstract");
        else
            _values = new List<T>();
    }
}


Ketil Wright
Reply With Quote
  #2 (permalink)  
Old July 14th, 2008, 12:06 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I came here to look at the errata when I saw that too. I was hoping it wasn't just me.

Reply With Quote
  #3 (permalink)  
Old May 22nd, 2013, 05:12 AM
Registered User
Points: 30, Level: 1
Points: 30, Level: 1 Points: 30, Level: 1 Points: 30, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I typed "if (typeof(T).IsAbstract == true)" in my C# instead of "if (typeof(T).IsAbstract == false)" and it worked fine.
A similar issue is already mentioned in the Errata for the VB code.

I tried using the Errata Form to report the problem in C# but the form was asking me for some password so I gave up
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error on source code 7-51? fedrok BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 October 15th, 2008 10:51 AM
select ONLY records 51-100 in a MySQL table crmpicco Classic ASP Databases 2 February 24th, 2005 06:21 AM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM



All times are GMT -4. The time now is 03:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.