synchronized_value documentation example fails to compile

Open
#374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
documentation

Research direction

Open doc/synchronized_value.qbk and compare the declared q1 and q2 with the synchronize(u1,u2) call and subsequent references. Update the example so its identifiers are consistent, then compile the documentation example to confirm it no longer fails.

Written by the indexing model from the issue text.

Description

The documentation gives the following example. u1 and u2 appear to be variable names, yet they appear to be undeclared.

  synchronized_value<std::queue<MessageType> > q1,q2;
  void transferMessage()
  {
    auto lks = synchronize(u1,u2); // dead-lock free algorithm

    if(!std::get<1>(lks)->empty())
    {
      std::get<2>(lks)->push_back(u1->front());
      std::get<1>(lks)->pop_front();
    }
  }
  
Dominant language
C++
Stars
213
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/thread

All issues in boostorg/thread

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.