Behavior of message_t::copy is unclear

Open Beginner friendly
#688 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
api

Research direction

Start by locating the message_t::copy declaration and its documentation, then inspect how it delegates to zmq_msg_copy and how callers use the parameter. Confirm that this is only a source-parameter naming clarification, update the declaration and any related documentation or tests, and verify the existing copy behavior remains unchanged.

Written by the indexing model from the issue text.

Description

message_t::copy is declared as

void copy(message_t &msg_)

  • it is unclear which is the source and which is the destination.
    (looking into the documentation, this is the destination, and msg_ is the source.
  • as I understand, msg_ isn't const, because the underlying zmq_msg_copy may need to modify the source's reference count.

If these observations are correct, I would suggest to rename the parameter to

void copy(message_t &source)

(can provide pull request, but I'm not sure if I'm missing some detail...)

Dominant language
C++
Stars
2.3k
Forks
798
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 zeromq/cppzmq

All issues in zeromq/cppzmq

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.