Closed Bug 1610066 Opened 5 years ago Closed 5 years ago

SafeElementAt on nsTArray<RefPtr<T>> requires complete type T.

Categories

(Core :: XPCOM, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(1 file)

Which makes us have a ton of silly includes.

TLDR this doesn't compile:

struct RefCounted;

class Foo {
  ~Foo(); // Intentionally out of line

  nsTArray<RefPtr<RefCounted>> mArray;

  RefCounted* GetFirst() const {
    return mArray.SafeElementAt(0);
  }
};
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8c0a314f916f Make nsTArray::SafeElementAt not require the complete type for smart pointers. r=froydnj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: