Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Open C++ - 'id' member variable of facet class cannot be accessed directly (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The id member variable of a facet class cannot be accessed directly in Open C++. Instead, it has to be accessed via the GetFacetLocaleId() interface.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1 and FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (12 Jun 2008)
Last edited: hamishwillee (19 Jun 2012)

Solution

The following code snippet demonstrates how to use locale::id when writing an application on top of the Standard Template Library (STL).

Declare a static method GetFacetLocaleId() instead of the member variable id, when defining a class which is inherited from class locale::facet.

  // b_facet.h 
class base_facet : public locale::facet
{
public:
static locale::id& GetFacetLocaleId(); // in place of static locale::id
};

In the source file, define the method GetFacetLocaleId():

// b_facet.cpp
locale::id base_facet_id;
locale::id& base_facet::GetFacetLocaleId()
{
return base_facet_id;
}
This page was last modified on 19 June 2012, at 07:57.
27 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×