It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

The template class describes an object that stores a
sequence of Bits bits. A bit is
set if its value is 1,
reset if its value is 0.
To flip a bit is to change its value
from 1 to 0 or from 0 to 1.
When converting between an object of
class bitset<Bits> and an object of some integral type,
bit position J corresponds to the bit value
1 << J. The integral value corresponding to two
or more bits is the sum of their bit values.

The first constructor resets all bits in the bit sequence.
The second constructor sets only those bits at position J
for which val & 1 << J is nonzero.

The third constructor determines the initial bit values from
elements of a string determined from str. If
str.size()
< pos, the constructor throws an object of class
out_of_range.
Otherwise, the effective length of the string rlen
is the smaller of count and
str.size() - pos. If any of the rlen
elements beginning at position pos is other than
digit0 or digit0 + 1, the constructor throws an object of class
invalid_argument.
Otherwise, the constructor sets only those bits at position J
for which the element at position pos + J is digit0 + 1.

The first member function flips all bits in the bit sequence,
then returns *this.
The second member function throws
out_of_range if
size()
<= pos. Otherwise, it flips the bit
at position pos, then returns *this.

The member operator function replaces
each element of the bit sequence stored
in *this with the element pos positions earlier
in the sequence. If no such earlier element exists, the function clears
the bit. The function returns *this.

The member function replaces each element of the bit sequence stored
in *this with the element pos positions later
in the sequence. If no such later element exists, the function clears
the bit. The function returns *this.

The member function returns an object of class
reference,
which designates the bit at position pos,
if the object can be modified. Otherwise, it returns
the value of the bit at position pos
in the bit sequence. If that position is
invalid, the behavior is undefined.

The member operator function replaces each element of the bit sequence stored
in *this with the logical
EXCLUSIVE OR of its previous value and
the corresponding bit in right.
The function returns *this.

The member class describes an object that designates an
individual bit within the bit sequence. Thus, for val
an object of type bool, bs and bs2
objects of type bitset<Bits>, and
I and J
valid positions within such an object, the member functions
of class reference ensure that (in order):

bs[I] = val stores val at bit position
I in bs

bs[I] = bs2[J] stores the value of the bit
bs2[J] at bit position
I in bs

val = ~bs[I] stores the flipped value of the bit
bs[I] in val

val = bs[I] stores the value of the bit
bs[I] in val

bs[I].flip() stores the flipped value of the bit
bs[I] back at bit position
I in bs

The first member function resets (or clears) all bits in the bit sequence,
then returns *this.
The second member function throws
out_of_range if
size()
<= pos. Otherwise, it resets the bit
at position pos, then returns *this.

The first member function sets all bits in the bit sequence,
then returns *this.
The second member function throws
out_of_range if
size()
<= pos. Otherwise, it stores val in the bit
at position pos, then returns *this.

The member function constructs str, an object of class
basic_string<Elem, Tr, Alloc>.
For each bit in the bit sequence, the function
appends digit0 + 1 if the bit is set, otherwise digit0.
The last element appended to str corresponds to
bit position zero. The function returns str.

The member function throws
overflow_error
if any bit in the bit sequence has a bit value that cannot be
represented as a value of type unsigned long. Otherwise,
it returns the sum of the bit values in the bit sequence.

The template function overloads operator>>
to store in right the value
bitset(str), where
str is an object of type
basic_string<Elem,
Tr, allocator<Elem> >& extracted
from istr. The function extracts elements and appends
them to str until:

Bits elements have been extracted and stored

end-of-file occurs on the input sequence

the next input element is neither digit0 nor digit0 + 1,
where digit0 is use_facet<
ctype<Elem> >(
istr.getloc()).
widen('0'),
in which case the input element is not extracted

If the function stores no characters in str, it calls
istr.setstate(ios_base::failbit).
In any case, it returns istr.

1. Choose your focus

This is the focus controller. Use this controller to choose your primary development approach (Cascades or Core).

By selecting a focus, you get to decide what content should be front and center on the site.

2. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

3. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades check boxes to display the samples relevant to your focus.

4. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

The documentation for your preferred focus always appears at the top of the left-hand navigation, but you can still access the rest of the documentation at the bottom.

5. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.